aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-08-03 10:40:45 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-08-03 10:40:45 +0200
commit215e478fa347e922ad47ace89316113f1b7f15cd (patch)
tree9fbb2fea24a135af7d64e86c709cbf0fbf430a29
parentc9fd7e01d8b155ec18b50fd08ff86ca64874a8b2 (diff)
downloadFront-215e478fa347e922ad47ace89316113f1b7f15cd.tar.gz
Front-215e478fa347e922ad47ace89316113f1b7f15cd.tar.zst
Front-215e478fa347e922ad47ace89316113f1b7f15cd.zip
Add view for augmented market configv0.0.26
-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}