Skip to content

Commit

Permalink
feat: 去除迁移的强校验
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Nov 26, 2024
1 parent 0f0ab6b commit c2aa4a4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
3 changes: 1 addition & 2 deletions internal/bootstrap/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ func initOrm() {

func runMigrate() {
migrator := gormigrate.New(app.Orm, &gormigrate.Options{
UseTransaction: true, // Note: MySQL not support DDL transaction
ValidateUnknownMigrations: true,
UseTransaction: true, // Note: MySQL not support DDL transaction
}, migration.Migrations)
if err := migrator.Migrate(); err != nil {
log.Fatalf("failed to migrate database: %v", err)
Expand Down
9 changes: 0 additions & 9 deletions internal/migration/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@ func init() {
)
},
})
Migrations = append(Migrations, &gormigrate.Migration{
ID: "20241107-database",
Migrate: func(tx *gorm.DB) error {
return nil
},
Rollback: func(tx *gorm.DB) error {
return nil
},
})
Migrations = append(Migrations, &gormigrate.Migration{
ID: "20241124-database",
Migrate: func(tx *gorm.DB) error {
Expand Down

0 comments on commit c2aa4a4

Please sign in to comment.