-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ALTER TYPE to update column types (#973)
* fixed alter type to update column types * tests for alter type with update table columns * make for loop more readable
- Loading branch information
1 parent
a29c34d
commit 9aad696
Showing
6 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/go/db.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/go/models.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
...nal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/go/query.sql.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/query.sql
This file contains 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,11 @@ | ||
CREATE TYPE event AS enum ('START', 'STOP'); | ||
|
||
CREATE TABLE log_lines ( | ||
id BIGSERIAL PRIMARY KEY, | ||
status "event" NOT NULL | ||
); | ||
|
||
ALTER TYPE event RENAME TO "new_event"; | ||
|
||
-- name: ListAuthors :many | ||
SELECT * FROM log_lines; |
12 changes: 12 additions & 0 deletions
12
internal/endtoend/testdata/ddl_alter_type_rename_and_update_columns/postgresql/sqlc.json
This file contains 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,12 @@ | ||
{ | ||
"version": "1", | ||
"packages": [ | ||
{ | ||
"path": "go", | ||
"engine": "postgresql", | ||
"name": "querytest", | ||
"schema": "query.sql", | ||
"queries": "query.sql" | ||
} | ||
] | ||
} |
This file contains 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