GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Schema Diff: generated script is no longer ordered by dependency (dependLevel is never set since the React port) · Issue #10295 · pgadmin-org/pgadmin4 Closed DescriptionBug Description Schema Diff no longer orders the script it generates by object dependency, so a script that contains an object and something that object depends on can easily be written the wrong way round and fails when it is run.
if (!(data.dependLevel in script_array)) script_array[data.dependLevel] = []; checkAndGetSchemaQuery(data, script_array); script_array[data.dependLevel].push(data.diff_ddl); and
To Reproduce Comparing two databases where a range type differs in kind (say a range in the source against an enum of the same name in the target) produces a script whose very first statement is the cast that the range's multirange type needs: CREATE CAST (test_schema_diff.typ_range_enum_diff AS test_schema_diff.typ_multirange_enum_diff) WITH FUNCTION typ_multirange_enum_diff(test_schema_diff.typ_range_enum_diff); whilst the Expected Behaviour The generated script should be ordered so that dependencies are created before the objects that need them, as it was before the React port. The header already warns that circular dependencies may make the order less than optimal, which rather understates the current position: there is no dependency ordering at all. Context Found whilst making the Schema Diff regression test assert that its generated script actually applies (#10293). The test cannot be made strict about the script as a whole until this is fixed, so it will be made strict about each object's SQL being valid in the meantime. Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |