From 0e8d49767bed33e7d528a28d38c6ca69dcaa2a91 Mon Sep 17 00:00:00 2001 From: Werner Date: Sat, 2 Nov 2019 11:21:34 +0100 Subject: [PATCH] Remove cargo data migration (#7283) --- code/controllers/subsystems/cargo.dm | 44 ---------------------------- 1 file changed, 44 deletions(-) diff --git a/code/controllers/subsystems/cargo.dm b/code/controllers/subsystems/cargo.dm index 5145f119baf..f5d6f1dfd32 100644 --- a/code/controllers/subsystems/cargo.dm +++ b/code/controllers/subsystems/cargo.dm @@ -89,48 +89,7 @@ var/datum/controller/subsystem/cargo/SScargo NEW_SS_GLOBAL(SScargo) -/* - Data Migrations -*/ -/datum/controller/subsystem/cargo/proc/run_migration_1() - if(!establish_db_connection(dbcon)) - log_debug("SScargo: SQL ERROR - Failed to connect. - Migration not executed") - return - //Gets those that havnt been migrated - var/DBQuery/item_query = dbcon.NewQuery("SELECT id, name, path_old, suppliers_old FROM ss13_cargo_items WHERE deleted_at is NULL AND items is NULL") - item_query.Execute() - while(item_query.NextRow()) - CHECK_TICK - //Gets the vars of the row - var/id = item_query.item[1] - var/name = item_query.item[2] - var/path = item_query.item[3] - var/list/suppliers = list() - try - suppliers = json_decode(item_query.item[4]) - catch(var/exception/e) - log_debug("SScargo: Error Decoding supplier data for item: [id] - [e]") - continue - - // Calculate the following items - //Supplier - The first supplier in the suppliers list - var/supplier - //Price - The price of the supplier - var/price - //Items - A list containing the items (only one for legacy items) and the attributes of the supplier - var/list/items = list() - for(var/sup in suppliers) - supplier = sup - price = suppliers[sup]["base_purchase_price"] - items[name] = list() - items[name]["path"] = path - items[name]["vars"] = suppliers[sup]["vars"] - break - - log_debug("Data Conversion for id: [id] - Supplier: [supplier] - Price: [price] - items: [json_encode(items)]") - var/DBQuery/update_query = dbcon.NewQuery("UPDATE ss13_cargo_items SET supplier = :supplier:, price = :price:, items = :items: WHERE id = :id:") - update_query.Execute(list("id"=id,"price"=price,"supplier"=supplier,"items"=json_encode(items))) /* Loading Data @@ -154,9 +113,6 @@ var/datum/controller/subsystem/cargo/SScargo //Reset the currently loaded data reset_cargo() - //Run the data migration - run_migration_1() - //Load the categories var/DBQuery/category_query = dbcon.NewQuery("SELECT name, display_name, description, icon, price_modifier FROM ss13_cargo_categories WHERE deleted_at IS NULL ORDER BY order_by ASC") category_query.Execute()