From ee2b0842f53a362ad8db0aed0c4e8c9738fe30cc Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 15 Nov 2024 16:53:47 +0800 Subject: [PATCH] migrations: add migration sql files for adding new net_profit column --- .../20241115165059_add_net_profit_column.sql | 15 +++++++++++++++ .../20241115165059_add_net_profit_column.sql | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 migrations/mysql/20241115165059_add_net_profit_column.sql create mode 100644 migrations/sqlite3/20241115165059_add_net_profit_column.sql diff --git a/migrations/mysql/20241115165059_add_net_profit_column.sql b/migrations/mysql/20241115165059_add_net_profit_column.sql new file mode 100644 index 000000000..73bdfcf50 --- /dev/null +++ b/migrations/mysql/20241115165059_add_net_profit_column.sql @@ -0,0 +1,15 @@ +-- +up +-- +begin +ALTER TABLE `positions` + ADD COLUMN `net_profit` DECIMAL(16, 8) DEFAULT 0.00000000 NOT NULL +; +-- +end + + +-- +down + +-- +begin +ALTER TABLE `positions` +DROP COLUMN `net_profit` +; +-- +end diff --git a/migrations/sqlite3/20241115165059_add_net_profit_column.sql b/migrations/sqlite3/20241115165059_add_net_profit_column.sql new file mode 100644 index 000000000..70595bb99 --- /dev/null +++ b/migrations/sqlite3/20241115165059_add_net_profit_column.sql @@ -0,0 +1,15 @@ +-- +up +-- +begin +ALTER TABLE `positions` + ADD COLUMN `net_profit` DECIMAL DEFAULT 0.00000000 NOT NULL +; +-- +end + + +-- +down + +-- +begin +ALTER TABLE `positions` +DROP COLUMN `net_profit` +; +-- +end