-
Notifications
You must be signed in to change notification settings - Fork 29
fix: non-primitive types qualified #145
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
Merged
Changes from all commits
Commits
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
Some comments aren't visible on the classic Files Changed page.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ALTER TABLE users ADD COLUMN email email_address NOT NULL; | ||
|
|
||
| ALTER TABLE users ADD COLUMN status user_status DEFAULT 'active' NOT NULL; |
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,13 @@ | ||
| -- New state: Add columns using custom types from setup.sql | ||
| -- Types (email_address, user_status) are created in setup.sql | ||
| -- Use unqualified names - types will be resolved via setup.sql context | ||
|
|
||
| -- Modified table with new columns using custom types | ||
| CREATE TABLE public.users ( | ||
| id bigint PRIMARY KEY, | ||
| username text NOT NULL, | ||
| created_at timestamp DEFAULT CURRENT_TIMESTAMP, | ||
| -- New columns using types from setup.sql | ||
| email email_address NOT NULL, | ||
| status user_status NOT NULL DEFAULT 'active' | ||
| ); |
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,6 @@ | ||
| -- Initial state: Basic table without custom types | ||
| CREATE TABLE public.users ( | ||
| id bigint PRIMARY KEY, | ||
| username text NOT NULL, | ||
| created_at timestamp DEFAULT CURRENT_TIMESTAMP | ||
| ); |
26 changes: 26 additions & 0 deletions
26
testdata/diff/create_table/add_column_custom_type/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,26 @@ | ||
| { | ||
| "version": "1.0.0", | ||
| "pgschema_version": "1.4.1", | ||
| "created_at": "1970-01-01T00:00:00Z", | ||
| "source_fingerprint": { | ||
| "hash": "4c7808528324af927b7ef815b8b70beac95edd62ed24c6da247a89cdf74ebb0f" | ||
| }, | ||
| "groups": [ | ||
| { | ||
| "steps": [ | ||
| { | ||
| "sql": "ALTER TABLE users ADD COLUMN email email_address NOT NULL;", | ||
| "type": "table.column", | ||
| "operation": "create", | ||
| "path": "public.users.email" | ||
| }, | ||
| { | ||
| "sql": "ALTER TABLE users ADD COLUMN status user_status DEFAULT 'active' NOT NULL;", | ||
| "type": "table.column", | ||
| "operation": "create", | ||
| "path": "public.users.status" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
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,3 @@ | ||
| ALTER TABLE users ADD COLUMN email email_address NOT NULL; | ||
|
|
||
| ALTER TABLE users ADD COLUMN status user_status DEFAULT 'active' NOT NULL; |
16 changes: 16 additions & 0 deletions
16
testdata/diff/create_table/add_column_custom_type/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,16 @@ | ||
| Plan: 1 to modify. | ||
|
|
||
| Summary by type: | ||
| tables: 1 to modify | ||
|
|
||
| Tables: | ||
| ~ users | ||
| + email (column) | ||
| + status (column) | ||
|
|
||
| DDL to be executed: | ||
| -------------------------------------------------- | ||
|
|
||
| ALTER TABLE users ADD COLUMN email email_address NOT NULL; | ||
|
|
||
| ALTER TABLE users ADD COLUMN status user_status DEFAULT 'active' NOT NULL; |
14 changes: 14 additions & 0 deletions
14
testdata/diff/create_table/add_column_custom_type/setup.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 @@ | ||
| -- Setup: Create types in public schema | ||
| -- This simulates extension types like citext installed in public schema | ||
|
|
||
| CREATE TYPE public.email_address AS ( | ||
| local_part text, | ||
| domain text | ||
| ); | ||
|
|
||
| CREATE TYPE public.user_status AS ENUM ( | ||
| 'active', | ||
| 'inactive', | ||
| 'suspended', | ||
| 'pending' | ||
| ); |
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.