-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add support for no_inherit
on column level constraints and in create_constraint
operation
#670
Add support for no_inherit
on column level constraints and in create_constraint
operation
#670
Conversation
14e8f7f
to
c7eacb4
Compare
18faa94
to
845f661
Compare
4d25638
to
9c405b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look OK, but I think the PR needs to be rebased to pick up relevant changes from main
, eg #665.
Table inheritance feels like a very rarely used Postgres feature; did this work arise from seeing it used somwhere like an ORM migration, or for completeness to cover all constraint options? In general, I think we need to be guided more by the former and add features only when we see them in use.
…reate constraint operation
I haven't seen this option in any ORM output yet. I added it for the sake of completeness. |
I won't close this PR, it comes with some nice cleanups. |
9c405b7
to
6f258f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
I think there are changes to sql2pgroll
needed too? For example this is supported now right?
pgroll/pkg/sql2pgroll/alter_table_test.go
Line 325 in f3432da
"ALTER TABLE foo ADD CONSTRAINT bar CHECK (age > 0) NO INHERIT", |
This PR adds a new option
no_inherit
to inline and table level check constraints increate_constraint
. It also makes sure that the check is duplicated correctly during migration. Also, I added the new attributenoInherit
to the output ofanalyze
/read_schema
.