"DROP TYPE portfolio_profile",
},
},
+ {
+ Version: 201808031000,
+ Up: []string{
+ `CREATE VIEW market_configs_augmented AS
+ SELECT market_configs.*,
+ COALESCE(u.portfolio_profile, g.portfolio_profile)
+ AS portfolio_profile
+ FROM market_configs
+ LEFT JOIN bot_settings AS u
+ ON u.user_id = market_configs.user_id,
+ (
+ SELECT portfolio_profile
+ FROM bot_settings
+ WHERE user_id IS NULL
+ ) AS g`,
+ },
+ Down: []string{
+ "DROP VIEW market_configs_augmented",
+ },
+ },
}