Skip to content
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

Change CREATE TABLE DEFAULT constraint handling #561

Open
wants to merge 1 commit into
base: fix-initially-immediate-constraints
Choose a base branch
from

Conversation

andrew-farries
Copy link
Collaborator

Change how CREATE TABLE statements like:

CREATE TABLE foo(a int DEFAULT NULL)

are converted to OpCreateTable operations.

When a column has a default value of NULL, the default field in the resulting Column object should be omitted, rather than set to "NULL".

This makes conversion of CREATE TABLE statements consistent with conversion of ALTER TABLE ADD COLUMN statements.

@andrew-farries andrew-farries marked this pull request as ready for review December 20, 2024 08:58
@andrew-farries andrew-farries added the sql2pgroll Issues relating to the sql2pgroll package label Dec 20, 2024
@andrew-farries andrew-farries changed the base branch from main to fix-initially-immediate-constraints December 20, 2024 11:40
@andrew-farries andrew-farries force-pushed the change-create-table-default-constraint-handling branch from b0140e7 to bd13dde Compare December 20, 2024 11:40
When a column has a default value of `NULL`, the `default` field in the
resulting `Column` object should be omitted, rather than set to
`"NULL"`.

This makes conversion of `CREATE TABLE` statements consistent with
conversion of `ALTER TABLE ADD COLUMN` statements.
@andrew-farries andrew-farries force-pushed the change-create-table-default-constraint-handling branch from bd13dde to 6637821 Compare December 20, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql2pgroll Issues relating to the sql2pgroll package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant