Skip to content

Commit edc9c80

Browse files
authored
Merge pull request #480 from chris-kobrzak/master
Defensively drop constraints during migrations
2 parents 97a055c + 49b7614 commit edc9c80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/migration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ function mixinMigration(PostgreSQL) {
586586
}
587587

588588
if (needsToDrop) {
589-
sql.push('DROP CONSTRAINT ' + self.escapeName(fk.fkName));
589+
sql.push('DROP CONSTRAINT IF EXISTS ' + self.escapeName(fk.fkName));
590590
removedFks.push(fk); // keep track that we removed these
591591
}
592592

0 commit comments

Comments
 (0)