Skip to content

Commit

Permalink
testutils/db: use schema provided by migrate data during export
Browse files Browse the repository at this point in the history
When exporting, use schema provided by migrate data and not the create data since the migration change the db shema to the migrate version.
  • Loading branch information
alessandro-sorint committed Oct 10, 2023
1 parent 6438214 commit 1b4e220
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/testutil/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,9 @@ func TestMigrate(t *testing.T, lastVersion uint, dataFixtures DataFixtures, setu

assert.Assert(t, len(diff) == 0, "schema of db created at version %d and db migrated from version %d to version %d is different:\n %s", migrateVersion, createVersion, migrateVersion, diff)

// set the db schema at the migrated version.
dc.Schema = createDataCreate.Tables

createExport := &bytes.Buffer{}
export := &bytes.Buffer{}

Expand Down

0 comments on commit 1b4e220

Please sign in to comment.