Only create index if not exists (#347)
This commit is contained in:
parent
0b947355da
commit
4397b90349
@ -74,7 +74,7 @@ func Open(ctx context.Context, DataPath, DBPath string) (db *DB, err error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = tx.Exec("CREATE INDEX idx_ttl_expires ON ttl (expires);")
|
_, err = tx.Exec("CREATE INDEX IF NOT EXISTS idx_ttl_expires ON ttl (expires);")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user