mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 01:01:56 +00:00
migrations: add margin info columns to nav table
This commit is contained in:
parent
b00c9f0c0d
commit
816f05cd88
19
migrations/mysql/20220503144849_add_margin_info_to_nav.sql
Normal file
19
migrations/mysql/20220503144849_add_margin_info_to_nav.sql
Normal file
|
@ -0,0 +1,19 @@
|
|||
-- +up
|
||||
-- +begin
|
||||
ALTER TABLE `nav_history_details`
|
||||
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
|
||||
;
|
||||
-- +end
|
||||
|
||||
|
||||
-- +down
|
||||
|
||||
-- +begin
|
||||
ALTER TABLE `nav_history_details`
|
||||
DROP COLUMN `net_asset`,
|
||||
DROP COLUMN `borrowed`,
|
||||
DROP COLUMN `price_in_usd`
|
||||
;
|
||||
-- +end
|
|
@ -0,0 +1,8 @@
|
|||
-- +up
|
||||
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;
|
||||
|
||||
-- +down
|
||||
-- we can not rollback alter table change in sqlite
|
||||
SELECT 1;
|
Loading…
Reference in New Issue
Block a user