@@ -26,13 +26,13 @@ import (
2626type (
2727 // MigrationBox is a embed migration box.
2828 MigrationBox struct {
29- c * pop.Connection
30- migrationsUp Migrations
31- migrationsDown Migrations
32- perMigrationTimeout time.Duration
33- l * logrusx.Logger
34- migrationContent MigrationContent
35- disableGoldenDatabase , hasTestData bool
29+ c * pop.Connection
30+ migrationsUp Migrations
31+ migrationsDown Migrations
32+ perMigrationTimeout time.Duration
33+ l * logrusx.Logger
34+ migrationContent MigrationContent
35+ disableGoldenDatabase bool
3636 }
3737 MigrationContent func (mf Migration , c * pop.Connection , r []byte , usingTemplate bool ) (string , error )
3838 MigrationBoxOption func (* MigrationBox )
@@ -91,7 +91,9 @@ var testdataPattern = regexp.MustCompile(`^(\d+)_testdata(|\.[a-zA-Z0-9]+).sql$`
9191// WithTestdata adds testdata to the migration box.
9292func WithTestdata (t * testing.T , testdata fs.FS ) MigrationBoxOption {
9393 return func (m * MigrationBox ) {
94- m .hasTestData = true
94+ // Testdata may not change the golden-database hash,
95+ // so it should not share or create a golden database.
96+ m .disableGoldenDatabase = true
9597 require .NoError (t , fs .WalkDir (testdata , "." , func (path string , info fs.DirEntry , err error ) error {
9698 if err != nil {
9799 return errors .WithStack (err )
0 commit comments