mirror of
https://github.com/writeas/writefreely
synced 2025-02-09 10:28:47 +01:00
Add SQLite query for v9 migration
This commit is contained in:
parent
b9c467558c
commit
5fe1dd1731
@ -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…
x
Reference in New Issue
Block a user