-
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.
Handle unconvertible
CREATE TABLE
table constraints (#549)
Ensure that SQL `CREATE TABLE` statements of the form: ```sql CREATE TABLE foo(a int, CONSTRAINT foo_check CHECK (a > 0)) CREATE TABLE foo(a int, CONSTRAINT foo_unique UNIQUE (a)) CREATE TABLE foo(a int, CONSTRAINT foo_pk PRIMARY KEY (a)) CREATE TABLE foo(a int, CONSTRAINT foo_fk FOREIGN KEY (a) REFERENCES bar(b)) CREATE TABLE foo(a int, CHECK (a > 0)) CREATE TABLE foo(a int, UNIQUE (a)) CREATE TABLE foo(a int, PRIMARY KEY (a)) CREATE TABLE foo(a int, FOREIGN KEY (a) REFERENCES bar(b)) ``` fall back to raw SQL due to the presence of the table level constraints, which aren't currently representable as a `pgroll` `OpCreateTable` operation. The PR only adds test cases as constraint table elements were already causing a fall back to raw SQL; only column definition table elements are converted.
- Loading branch information
1 parent
d507dbe
commit d933a4f
Showing
2 changed files
with
36 additions
and
35 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