diff options
-rw-r--r-- | db/migrations.go | 17 |
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 | } |