aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjloup <jean-loup.jamet@trainline.com>2018-08-03 00:09:57 +0200
committerjloup <jean-loup.jamet@trainline.com>2018-08-03 10:05:43 +0200
commitc9fd7e01d8b155ec18b50fd08ff86ca64874a8b2 (patch)
tree091918fe933041e63d8aa3eea332dcd30449e847
parent1fcb77583201f9979a839fcae2dd642edc25af96 (diff)
downloadFront-bot-settings.tar.gz
Front-bot-settings.tar.zst
Front-bot-settings.zip
bot_setting table.v0.0.25bot-settings
-rw-r--r--db/migrations.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrations.go b/db/migrations.go
index e8fc40d..1a105fc 100644
--- a/db/migrations.go
+++ b/db/migrations.go
@@ -100,4 +100,21 @@ var migrations []Migration = []Migration{
100 "DROP TYPE user_role", 100 "DROP TYPE user_role",
101 }, 101 },
102 }, 102 },
103 {
104 Version: 201807311000,
105 Up: []string{
106 "CREATE TYPE portfolio_profile AS ENUM ('high-liquidity', 'medium-liquidity')",
107 `CREATE TABLE bot_settings (
108 id BIGSERIAL PRIMARY KEY,
109 user_id bigint REFERENCES users(id) ON DELETE CASCADE,
110 portfolio_profile portfolio_profile
111 )`,
112 `CREATE INDEX IF NOT EXISTS bot_settings_user_id ON bot_settings (user_id)`,
113 `CREATE UNIQUE INDEX bot_settings_unique_null_user_id ON bot_settings (coalesce(user_id, 0))`,
114 },
115 Down: []string{
116 "DROP TABLE bot_settings",
117 "DROP TYPE portfolio_profile",
118 },
119 },
103} 120}