mirror of https://github.com/containers/podman.git
sqlite: move migration after table creation
Otherwise we'll fail immediately as the schema version is returned as 0. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
parent
eeabe975ea
commit
8c64c4370f
|
@ -64,15 +64,15 @@ func NewSqliteState(runtime *Runtime) (_ State, defErr error) {
|
|||
return nil, fmt.Errorf("setting full fsync mode in db: %w", err)
|
||||
}
|
||||
|
||||
if err := state.migrateSchemaIfNecessary(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Set up tables
|
||||
if err := sqliteInitTables(state.conn); err != nil {
|
||||
return nil, fmt.Errorf("creating tables: %w", err)
|
||||
}
|
||||
|
||||
if err := state.migrateSchemaIfNecessary(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
state.valid = true
|
||||
state.runtime = runtime
|
||||
|
||||
|
|
Loading…
Reference in New Issue