diff --git a/migrations/mysql/20220504184155_fix_net_asset_column.sql b/migrations/mysql/20220504184155_fix_net_asset_column.sql new file mode 100644 index 000000000..77f130865 --- /dev/null +++ b/migrations/mysql/20220504184155_fix_net_asset_column.sql @@ -0,0 +1,17 @@ +-- +up +-- +begin +ALTER TABLE `nav_history_details` + MODIFY COLUMN `net_asset` DECIMAL(32, 8) DEFAULT 0.00000000 NOT NULL; +-- +end + +-- +begin +ALTER TABLE `nav_history_details` + ADD COLUMN `interest` DECIMAL(32, 20) UNSIGNED DEFAULT 0.00000000 NOT NULL; +-- +end + +-- +down + +-- +begin +ALTER TABLE `nav_history_details` + DROP COLUMN `interest`; +-- +end diff --git a/migrations/sqlite3/20220503144849_add_margin_info_to_nav.sql b/migrations/sqlite3/20220503144849_add_margin_info_to_nav.sql index 9f6cec2da..921d78bed 100644 --- a/migrations/sqlite3/20220503144849_add_margin_info_to_nav.sql +++ b/migrations/sqlite3/20220503144849_add_margin_info_to_nav.sql @@ -1,7 +1,7 @@ -- +up 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 `net_asset` DECIMAL 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; diff --git a/migrations/sqlite3/20220504184155_fix_net_asset_column.sql b/migrations/sqlite3/20220504184155_fix_net_asset_column.sql new file mode 100644 index 000000000..96993735e --- /dev/null +++ b/migrations/sqlite3/20220504184155_fix_net_asset_column.sql @@ -0,0 +1,11 @@ +-- +up +-- +begin +ALTER TABLE `nav_history_details` ADD COLUMN `interest` DECIMAL DEFAULT 0.00000000 NOT NULL; +-- +end + + +-- +down + +-- +begin +SELECT 1; +-- +end