Commit db807adf authored by Amos Wenger's avatar Amos Wenger

Use timestamp in the migration tablename in case we get violently interrupted...

Use timestamp in the migration tablename in case we get violently interrupted in the middle of something
parent dbb7363e
Pipeline #12317 passed with stage
in 52 seconds
......@@ -90,7 +90,7 @@ func (c *Context) syncTable(conn *sqlite.Conn, stats *AutoMigrateStats, ms *Mode
}
stats.NumMigrated++
tempName := fmt.Sprintf("__hades_migrate__%s__", tableName)
tempName := fmt.Sprintf("__hades_migrate__%s__%d__", tableName, time.Now().UnixNano())
err = c.ExecRaw(conn, fmt.Sprintf("CREATE TABLE %s AS SELECT * FROM %s", tempName, tableName), nil)
if err != nil {
return err
......
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