From 3ce9d20a2be37c5bd525ec2cb4e67d7a6290eef7 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 25 Sep 2024 16:05:12 +0800 Subject: [PATCH] migrations: fix symbol lengths --- migrations/mysql/20220304153317_add_profit_table.sql | 4 ++-- migrations/mysql/20220307132917_add_positions.sql | 4 ++-- migrations/mysql/20220512170322_fix_profit_symbol_length.sql | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/migrations/mysql/20220304153317_add_profit_table.sql b/migrations/mysql/20220304153317_add_profit_table.sql index 96037a09c..9a1d44d9d 100644 --- a/migrations/mysql/20220304153317_add_profit_table.sql +++ b/migrations/mysql/20220304153317_add_profit_table.sql @@ -6,7 +6,7 @@ CREATE TABLE `profits` `strategy` VARCHAR(32) NOT NULL, `strategy_instance_id` VARCHAR(64) NOT NULL, - `symbol` VARCHAR(8) NOT NULL, + `symbol` VARCHAR(30) NOT NULL, -- average_cost is the position average cost `average_cost` DECIMAL(16, 8) UNSIGNED NOT NULL, @@ -25,7 +25,7 @@ CREATE TABLE `profits` `quote_currency` VARCHAR(10) NOT NULL, - `base_currency` VARCHAR(10) NOT NULL, + `base_currency` VARCHAR(15) NOT NULL, -- ------------------------------------------------------- -- embedded trade data -- diff --git a/migrations/mysql/20220307132917_add_positions.sql b/migrations/mysql/20220307132917_add_positions.sql index ca10e14d9..01be64b26 100644 --- a/migrations/mysql/20220307132917_add_positions.sql +++ b/migrations/mysql/20220307132917_add_positions.sql @@ -6,9 +6,9 @@ CREATE TABLE `positions` `strategy` VARCHAR(32) NOT NULL, `strategy_instance_id` VARCHAR(64) NOT NULL, - `symbol` VARCHAR(20) NOT NULL, + `symbol` VARCHAR(32) NOT NULL, `quote_currency` VARCHAR(10) NOT NULL, - `base_currency` VARCHAR(10) NOT NULL, + `base_currency` VARCHAR(15) NOT NULL, -- average_cost is the position average cost `average_cost` DECIMAL(16, 8) UNSIGNED NOT NULL, diff --git a/migrations/mysql/20220512170322_fix_profit_symbol_length.sql b/migrations/mysql/20220512170322_fix_profit_symbol_length.sql index 60bc96be9..de2c33797 100644 --- a/migrations/mysql/20220512170322_fix_profit_symbol_length.sql +++ b/migrations/mysql/20220512170322_fix_profit_symbol_length.sql @@ -1,7 +1,7 @@ -- +up -- +begin ALTER TABLE profits - CHANGE symbol symbol VARCHAR(20) NOT NULL; + CHANGE symbol symbol VARCHAR(32) NOT NULL; -- +end -- +down