mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
migrations: merge pnl, strategy migration
This commit is contained in:
parent
32a5cd9f85
commit
a8b35867a5
|
@ -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`)
|
||||||
);
|
);
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user