Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/migration_acceptance_tests/function_cases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ var functionAcceptanceTestCases = []acceptanceTestCase{
RETURNS NULL ON NULL INPUT
RETURN CONCAT(a, b);

-- identical function on a different schem
-- identical function on a different schema
CREATE SCHEMA schema_2;
CREATE FUNCTION schema_2.add(a integer, b integer) RETURNS text
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT
RETURN CONCAT(a, b);
RETURN CONCAT(a, b);
`},
expectedHazardTypes: []diff.MigrationHazardType{diff.MigrationHazardTypeHasUntrackableDependencies},
},
Expand Down Expand Up @@ -248,7 +248,7 @@ var functionAcceptanceTestCases = []acceptanceTestCase{
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT
RETURN CONCAT(a, b);
RETURN CONCAT(a, b);
`,
},
expectedHazardTypes: []diff.MigrationHazardType{diff.MigrationHazardTypeHasUntrackableDependencies},
Expand Down
2 changes: 1 addition & 1 deletion pkg/diff/materialized_view_sql_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func buildMaterializedViewDiff(
// and that column/table is deleted/recreated. In part, this is because we cannot depend on individual column
// changes...all added and removes columns are combined into the same SQL vertex.
// - See https://github.com/stripe/pg-schema-diff/issues/135#issuecomment-2357382217 for details.
// - For some table X, it is currently not possible to create a SQL statement outside the table sql genreator
// - For some table X, it is currently not possible to create a SQL statement outside the table sql generator
// that comes before a column Y's delete statement but after a column Z's add statement.
for _, t := range old.TableDependencies {
if _, ok := deletedTablesByName[t.GetName()]; ok {
Expand Down
2 changes: 1 addition & 1 deletion pkg/diff/sql_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ func buildIndexesByTableNameMap(indexes []schema.Index) map[string][]schema.Inde

// buildChildrenByPartitionedIndexNameMap builds a map of indexes by their parent index name. This map will include
// all descendents, not just direct descendents. For example, if foobar idx has 5 children and each of those children
// has 5 children, the slice for foobar index wil contain 30 indexes (the 5 direct children and the 25 "grandchildren")
// has 5 children, the slice for foobar index will contain 30 indexes (the 5 direct children and the 25 "grandchildren")
func buildChildrenByPartitionedIndexNameMap(indexes []schema.Index) map[string][]schema.Index {
// Build a map of children by their direct parent index
var childrenByDirectParentIdxName = make(map[string][]schema.Index)
Expand Down
2 changes: 1 addition & 1 deletion pkg/diff/view_sql_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func buildViewDiff(
// and that column/table is deleted/recreated. In part, this is because we cannot depend on individual column
// changes...all added and removes columns are combined into the same SQL vertex.
// - See https://github.com/stripe/pg-schema-diff/issues/135#issuecomment-2357382217 for details.
// - For some table X, it is currently not possible to create a SQL statement outside the table sql genreator
// - For some table X, it is currently not possible to create a SQL statement outside the table sql generator
// that comes before a column Y's delete statement but after a column Z's add statement.
for _, t := range old.TableDependencies {
if _, ok := deletedTablesByName[t.GetName()]; ok {
Expand Down
Loading