diff --git a/migrations/mysql/20220503144849_add_margin_info_to_nav.sql b/migrations/mysql/20220503144849_add_margin_info_to_nav.sql index 28cd1dd35..618b3435f 100644 --- a/migrations/mysql/20220503144849_add_margin_info_to_nav.sql +++ b/migrations/mysql/20220503144849_add_margin_info_to_nav.sql @@ -2,6 +2,9 @@ -- +begin ALTER TABLE `nav_history_details` ADD COLUMN `session` VARCHAR(30) NOT NULL, + ADD COLUMN `is_margin` BOOLEAN NOT NULL DEFAULT FALSE, + ADD COLUMN `is_isolated` BOOLEAN NOT NULL DEFAULT FALSE, + ADD COLUMN `isolated_symbol` VARCHAR(30) NOT NULL DEFAULT '', ADD COLUMN `net_asset` DECIMAL(32, 8) UNSIGNED DEFAULT 0.00000000 NOT NULL, ADD COLUMN `borrowed` DECIMAL(32, 8) UNSIGNED DEFAULT 0.00000000 NOT NULL, ADD COLUMN `price_in_usd` DECIMAL(32, 8) UNSIGNED DEFAULT 0.00000000 NOT NULL @@ -16,6 +19,9 @@ ALTER TABLE `nav_history_details` DROP COLUMN `session`, DROP COLUMN `net_asset`, DROP COLUMN `borrowed`, - DROP COLUMN `price_in_usd` + DROP COLUMN `price_in_usd`, + DROP COLUMN `is_margin`, + DROP COLUMN `is_isolated`, + DROP COLUMN `isolated_symbol` ; -- +end diff --git a/migrations/sqlite3/20220503144849_add_margin_info_to_nav.sql b/migrations/sqlite3/20220503144849_add_margin_info_to_nav.sql index 745638a7d..9f6cec2da 100644 --- a/migrations/sqlite3/20220503144849_add_margin_info_to_nav.sql +++ b/migrations/sqlite3/20220503144849_add_margin_info_to_nav.sql @@ -3,6 +3,9 @@ ALTER TABLE `nav_history_details` ADD COLUMN `session` VARCHAR(50) NOT NULL; ALTER TABLE `nav_history_details` ADD COLUMN `borrowed` DECIMAL UNSIGNED DEFAULT 0.00000000 NOT NULL; ALTER TABLE `nav_history_details` ADD COLUMN `net_asset` DECIMAL UNSIGNED DEFAULT 0.00000000 NOT NULL; ALTER TABLE `nav_history_details` ADD COLUMN `price_in_usd` DECIMAL UNSIGNED DEFAULT 0.00000000 NOT NULL; +ALTER TABLE `nav_history_details` ADD COLUMN `is_margin` BOOL DEFAULT FALSE NOT NULL; +ALTER TABLE `nav_history_details` ADD COLUMN `is_isolated` BOOL DEFAULT FALSE NOT NULL; +ALTER TABLE `nav_history_details` ADD COLUMN `isolated_symbol` VARCHAR(30) DEFAULT '' NOT NULL; -- +down -- we can not rollback alter table change in sqlite