set pipe concat mode when using mysql

This commit is contained in:
Danny 2018-06-01 11:44:11 +02:00
parent 6f45edc790
commit c9213b0b72

View File

@ -29,6 +29,12 @@ func New(c *Config) *sqlstore {
// write log statement
log.Infof("Connected to %s database: %s", c.Driver, c.Name)
// Driver specific database options
if c.Driver == "mysql" {
// Because SQLite doesn't have CONCAT, tell MySQL to accept pipes for concatenating string columns
db.Exec("SET sql_mode=PIPES_AS_CONCAT;")
}
// run migrations
db.Migrate()