Skip to content

Commit

Permalink
Recreate the migrations table instead of truncating, for performance …
Browse files Browse the repository at this point in the history
…reasons
  • Loading branch information
Dobefu committed Nov 28, 2024
1 parent 134fb9b commit 15e9572
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/migrate_db/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,13 @@ func setMigrationState(version int, dirty bool) error {
return err
}

_, err = database.DB.Exec("DELETE FROM migrations")
_, err = database.DB.Exec("DROP table migrations")

if err != nil {
return err
}

err = createMigrationsTable()

if err != nil {
return err
Expand Down

0 comments on commit 15e9572

Please sign in to comment.