Skip to content

Commit

Permalink
Fixed migr. checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Solution committed Jan 5, 2021
1 parent d8d4164 commit cd8aeb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion migrationManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ func (mm MigrationManager) RemoveMigration(id string) {
}

func (mm MigrationManager) IsMigrationExecuted(id string) bool {
res := mm.db.Find(NewMigrationTable())
var existingMigration MigrationTable
res := mm.db.Where("migration_id = ?", id).First(&existingMigration)
if res.Error != nil && errors.Is(res.Error, gorm.ErrRecordNotFound) {
return false
}
Expand Down

0 comments on commit cd8aeb0

Please sign in to comment.