mirror of
https://github.com/go-shiori/shiori.git
synced 2025-09-18 10:59:37 +08:00
fix: use mysql json default as expression (#1048)
This commit is contained in:
parent
e1e58289a2
commit
d75de89701
2 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS account(
|
|||
username VARCHAR(250) NOT NULL,
|
||||
password BINARY(80) NOT NULL,
|
||||
owner TINYINT(1) NOT NULL DEFAULT '0',
|
||||
config JSON NOT NULL DEFAULT '{}',
|
||||
config JSON NOT NULL DEFAULT ('{}'),
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY account_username_UNIQUE (username))
|
||||
CHARACTER SET utf8mb4;
|
||||
|
|
|
@ -48,7 +48,7 @@ var mysqlMigrations = []migration{
|
|||
}
|
||||
defer tx.Rollback()
|
||||
|
||||
_, err = tx.Exec(`ALTER TABLE account ADD COLUMN config JSON NOT NULL DEFAULT '{}'`)
|
||||
_, err = tx.Exec(`ALTER TABLE account ADD COLUMN config JSON NOT NULL DEFAULT ('{}')`)
|
||||
if err != nil && strings.Contains(err.Error(), `Duplicate column name`) {
|
||||
tx.Rollback()
|
||||
} else if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue