Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: alexaub-stripe <[email protected]>
  • Loading branch information
bplunkett-stripe and alexaub-stripe authored Aug 10, 2023
1 parent 1475640 commit e5403fb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/diff/sql_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1512,8 +1512,7 @@ func (f *foreignKeyConstraintSQLVertexGenerator) GetDeleteDependencies(con schem
mustRun(f.GetSQLVertexId(con), diffTypeDelete).before(buildTableVertexId(con.OwningTableUnescapedName), diffTypeDelete),
mustRun(f.GetSQLVertexId(con), diffTypeDelete).before(buildTableVertexId(con.ForeignTableUnescapedName), diffTypeDelete),
}
// This is the slightly lazy way of ensuring the foreign key constraint is added after the requisite index is
// built and marked as valid.
// This is the slightly lazy way of ensuring the foreign key constraint is deleted before the index it depends on is deleted
// We __could__ do this just for the index the fk depends on, but that's slightly more wiring than we need right now
// because of partitioned indexes, which are only valid when all child indexes have been built
for _, i := range f.indexInOldSchemaByTableName[con.ForeignTableUnescapedName] {
Expand Down

0 comments on commit e5403fb

Please sign in to comment.