-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use expression deparsing to convert column
DEFAULT
expressions (#535)
Deparse column `DEFAULT` expressions using `pg_query_go.DeparseExpr` to allow conversion of arbitrary expressions in column `DEFAULT`s to `pgroll` migrations. Replace manual deparsing of literal nodes with use of `DeparseExpr` to allow deparsing of any column `DEFAULT` expression. Update test cases: * `ALTER TABLE foo ALTER COLUMN bar SET DEFAULT now()` is now representable as an `OpAlterColumn`; no need to fall back to raw SQL anymore. * Add a new testcase: `ALTER TABLE foo ALTER COLUMN bar SET DEFAULT (first_name || ' ' || last_name)` to demonstrate conversion of a column `DEFAULT` using a more complex expression. Part of #504
- Loading branch information
1 parent
de49197
commit 694d935
Showing
3 changed files
with
32 additions
and
25 deletions.
There are no files selected for viewing
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
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
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