-
Notifications
You must be signed in to change notification settings - Fork 57
fix: emit per-child column overrides in PARTITION OF (#499) #500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+117
−9
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d775dc1
fix: emit per-child column overrides (DEFAULT, NOT NULL) in PARTITION…
tianzhou 7decbf3
fix: use allNewTables from target IR for parent lookup
tianzhou 0c77576
fix: update plan.json hash for existing_parent test case
tianzhou e92bd03
refactor: consolidate issue_499 test fixtures into one
tianzhou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
testdata/diff/create_table/issue_499_partition_column_overrides/diff.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| CREATE TABLE IF NOT EXISTS orders_us PARTITION OF orders ( | ||
| priority DEFAULT 10, | ||
| notes NOT NULL | ||
| ) FOR VALUES IN ('us'); |
14 changes: 14 additions & 0 deletions
14
testdata/diff/create_table/issue_499_partition_column_overrides/new.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| CREATE TABLE public.orders ( | ||
| id bigint NOT NULL, | ||
| region text NOT NULL, | ||
| priority integer DEFAULT 0, | ||
| notes text | ||
| ) PARTITION BY LIST (region); | ||
|
|
||
| CREATE TABLE public.orders_eu PARTITION OF public.orders | ||
| FOR VALUES IN ('eu'); | ||
|
|
||
| CREATE TABLE public.orders_us PARTITION OF public.orders ( | ||
| priority DEFAULT 10, | ||
| notes NOT NULL | ||
| ) FOR VALUES IN ('us'); |
9 changes: 9 additions & 0 deletions
9
testdata/diff/create_table/issue_499_partition_column_overrides/old.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| CREATE TABLE public.orders ( | ||
| id bigint NOT NULL, | ||
| region text NOT NULL, | ||
| priority integer DEFAULT 0, | ||
| notes text | ||
| ) PARTITION BY LIST (region); | ||
|
|
||
| CREATE TABLE public.orders_eu PARTITION OF public.orders | ||
| FOR VALUES IN ('eu'); |
20 changes: 20 additions & 0 deletions
20
testdata/diff/create_table/issue_499_partition_column_overrides/plan.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "version": "1.0.0", | ||
| "pgschema_version": "1.11.1", | ||
| "created_at": "1970-01-01T00:00:00Z", | ||
| "source_fingerprint": { | ||
| "hash": "8872790ced32fbe419a3297dfdcd20a1b6e17650d2dcb1773161f505b66b2be8" | ||
| }, | ||
| "groups": [ | ||
| { | ||
| "steps": [ | ||
| { | ||
| "sql": "CREATE TABLE IF NOT EXISTS orders_us PARTITION OF orders (\n priority DEFAULT 10,\n notes NOT NULL\n) FOR VALUES IN ('us');", | ||
| "type": "table", | ||
| "operation": "create", | ||
| "path": "public.orders_us" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
4 changes: 4 additions & 0 deletions
4
testdata/diff/create_table/issue_499_partition_column_overrides/plan.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| CREATE TABLE IF NOT EXISTS orders_us PARTITION OF orders ( | ||
| priority DEFAULT 10, | ||
| notes NOT NULL | ||
| ) FOR VALUES IN ('us'); |
15 changes: 15 additions & 0 deletions
15
testdata/diff/create_table/issue_499_partition_column_overrides/plan.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| Plan: 1 to add. | ||
|
|
||
| Summary by type: | ||
| tables: 1 to add | ||
|
|
||
| Tables: | ||
| + orders_us | ||
|
|
||
| DDL to be executed: | ||
| -------------------------------------------------- | ||
|
|
||
| CREATE TABLE IF NOT EXISTS orders_us PARTITION OF orders ( | ||
| priority DEFAULT 10, | ||
| notes NOT NULL | ||
| ) FOR VALUES IN ('us'); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.