migrations: merge pnl, strategy migration

This commit is contained in:
c9s 2022-03-11 13:34:35 +08:00
parent 32a5cd9f85
commit a8b35867a5
2 changed files with 5 additions and 12 deletions

View File

@ -20,6 +20,9 @@ CREATE TABLE `trades`
`is_margin` BOOLEAN NOT NULL DEFAULT FALSE, `is_margin` BOOLEAN NOT NULL DEFAULT FALSE,
`is_isolated` BOOLEAN NOT NULL DEFAULT FALSE, `is_isolated` BOOLEAN NOT NULL DEFAULT FALSE,
`strategy` VARCHAR(32) NULL,
`pnl` DECIMAL NULL,
PRIMARY KEY (`gid`), PRIMARY KEY (`gid`),
UNIQUE KEY `id` (`exchange`, `symbol`, `side`, `id`) UNIQUE KEY `id` (`exchange`, `symbol`, `side`, `id`)
); );

View File

@ -1,19 +1,9 @@
-- +up -- +up
-- +begin -- +begin
ALTER TABLE `trades` ADD COLUMN `pnl` DECIMAL NULL; SELECT 1;
-- +end -- +end
-- +begin
ALTER TABLE `trades` ADD COLUMN `strategy` VARCHAR(32) NULL;
-- +end
-- +down -- +down
-- +begin -- +begin
ALTER TABLE `trades` DROP COLUMN `pnl`; SELECT 1;
-- +end
-- +begin
ALTER TABLE `trades` DROP COLUMN `strategy`;
-- +end -- +end