database: migration in transaction

This commit is contained in:
genofire 2022-06-06 01:56:24 +02:00
parent 843a985be7
commit 2aee702fc6
1 changed files with 7 additions and 1 deletions

View File

@ -28,7 +28,13 @@ func (config *Database) setupMigrator(testdata bool) (*gormigrate.Gormigrate, er
return nil, ErrNothingToMigrate return nil, ErrNothingToMigrate
} }
return gormigrate.New(config.DB, gormigrate.DefaultOptions, migrations), nil return gormigrate.New(config.DB, &gormigrate.Options{
TableName: "migrations",
IDColumnName: "id",
IDColumnSize: 255,
UseTransaction: true,
ValidateUnknownMigrations: false,
}, migrations), nil
} }