aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/migrations.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrations.go b/db/migrations.go
index 1a105fc..9246eaa 100644
--- a/db/migrations.go
+++ b/db/migrations.go
@@ -117,4 +117,24 @@ var migrations []Migration = []Migration{
117 "DROP TYPE portfolio_profile", 117 "DROP TYPE portfolio_profile",
118 }, 118 },
119 }, 119 },
120 {
121 Version: 201808031000,
122 Up: []string{
123 `CREATE VIEW market_configs_augmented AS
124 SELECT market_configs.*,
125 COALESCE(u.portfolio_profile, g.portfolio_profile)
126 AS portfolio_profile
127 FROM market_configs
128 LEFT JOIN bot_settings AS u
129 ON u.user_id = market_configs.user_id,
130 (
131 SELECT portfolio_profile
132 FROM bot_settings
133 WHERE user_id IS NULL
134 ) AS g`,
135 },
136 Down: []string{
137 "DROP VIEW market_configs_augmented",
138 },
139 },
120} 140}