Skip to content

Commit dfc052a

Browse files
authored
Added param for enabling/disabling hash comparison
1 parent 519f315 commit dfc052a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

database/migrations.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (d *Database) GetCurrentMigration() (Migration, error) {
5252
return migration, err
5353
}
5454

55-
func (d *Database) DiffMigrations() ([]Migration, error) {
55+
func (d *Database) DiffMigrations(compareHashes bool) ([]Migration, error) {
5656
currentMigration, err := d.GetCurrentMigration()
5757
if err != nil {
5858
return nil, err
@@ -96,7 +96,7 @@ func (d *Database) DiffMigrations() ([]Migration, error) {
9696
Complete: uint64(version) <= currentMigration.Version,
9797
}
9898

99-
if migration.Version == currentMigration.Version && migration.Hash != currentMigration.Hash {
99+
if compareHashes && migration.Version == currentMigration.Version && migration.Hash != currentMigration.Hash {
100100
return errors.New("migrations are up to date but appear to have been modified (latest hash mismatch)")
101101
}
102102

0 commit comments

Comments
 (0)