mirror of
https://github.com/writefreely/writefreely
synced 2024-11-24 09:33:11 +00:00
Add SQLite query for v9 migration
This commit is contained in:
parent
b9c467558c
commit
5fe1dd1731
1 changed files with 5 additions and 1 deletions
|
@ -17,7 +17,11 @@ func optimizeDrafts(db *datastore) error {
|
|||
return err
|
||||
}
|
||||
|
||||
_, err = t.Exec(`ALTER TABLE posts ADD INDEX(owner_id, id)`)
|
||||
if db.driverName == driverSQLite {
|
||||
_, err = t.Exec(`CREATE INDEX key_owner_post_id ON posts (owner_id, id)`)
|
||||
} else {
|
||||
_, err = t.Exec(`ALTER TABLE posts ADD INDEX(owner_id, id)`)
|
||||
}
|
||||
if err != nil {
|
||||
t.Rollback()
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue