fix(db): apply all migrations and schema in one transaction

This commit is contained in:
Jakob Borg
2025-08-31 12:43:41 +02:00
parent 21ad99c80a
commit e41d6b9c1e
4 changed files with 42 additions and 21 deletions
+6 -1
View File
@@ -81,7 +81,12 @@ func TestBasics(t *testing.T) {
)
t.Run("SchemaVersion", func(t *testing.T) {
ver, err := sdb.getAppliedSchemaVersion()
tx, err := sdb.sql.Beginx()
if err != nil {
t.Fatal(err)
}
defer tx.Rollback()
ver, err := sdb.getAppliedSchemaVersion(tx)
if err != nil {
t.Fatal(err)
}