Commit dbb7363e authored by Amos Wenger's avatar Amos Wenger

Actually return errors in automigrate

parent fe967d8b
Pipeline #12316 passed with stage
in 1 minute and 20 seconds
......@@ -47,7 +47,7 @@ func (c *Context) syncTable(conn *sqlite.Conn, stats *AutoMigrateStats, ms *Mode
err = c.ExecRaw(conn, "PRAGMA foreign_keys = 0", nil)
if err != nil {
return nil
return err
}
oldColumns := make(map[string]PragmaTableInfoRow)
......@@ -93,12 +93,12 @@ func (c *Context) syncTable(conn *sqlite.Conn, stats *AutoMigrateStats, ms *Mode
tempName := fmt.Sprintf("__hades_migrate__%s__", tableName)
err = c.ExecRaw(conn, fmt.Sprintf("CREATE TABLE %s AS SELECT * FROM %s", tempName, tableName), nil)
if err != nil {
return nil
return err
}
err = c.dropTable(conn, tableName)
if err != nil {
return nil
return err
}
err = c.createTable(conn, ms)
......@@ -139,17 +139,17 @@ func (c *Context) syncTable(conn *sqlite.Conn, stats *AutoMigrateStats, ms *Mode
err = c.ExecRaw(conn, query, nil)
if err != nil {
return nil
return err
}
err = c.dropTable(conn, tempName)
if err != nil {
return nil
return err
}
err = c.ExecRaw(conn, "PRAGMA foreign_keys = 1", nil)
if err != nil {
return nil
return err
}
return nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment