Skip to content

Commit

Permalink
Fix tests (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
nielm authored Jan 29, 2024
1 parent 164b627 commit e3953b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public void parseCreateTable() throws ParseException {
+ " test.other_table ( other_col1, other_col2 ) ON DELETE CASCADE, \n"
+ " CONSTRAINT fk_col_remote2 FOREIGN KEY ( col1 ) REFERENCES test.other_table\n"
+ " ( other_col1 ) ON DELETE NO ACTION, \n"
+ " CONSTRAINT check_some_value CHECK (( length ( sizedstring ) > 100 OR \n"
+ " sizedstring = \"xxx\" ) AND boolcol = TRUE AND intcol > -123.4 AND \n"
+ " CONSTRAINT check_some_value CHECK (( length ( sizedstring ) > 100 or \n"
+ " sizedstring = \"xxx\" ) AND boolcol = true and intcol > -123.4 and \n"
+ " numericcol < 1.5)\n"
+ ")\n"
+ "PRIMARY KEY (intcol ASC, floatcol DESC, boolcol ASC), \n"
Expand Down
10 changes: 5 additions & 5 deletions src/test/resources/expectedDdlDiff.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,24 +105,24 @@ DROP TABLE test2
ALTER TABLE test1 ADD COLUMN col3 INT64
CREATE TABLE test3 ( col1 INT64 ) PRIMARY KEY (col1 ASC)
CREATE INDEX index1 ON test1 ( col3 ASC )
ALTER TABLE test3 ADD CONSTRAINT ch_in_test3 CHECK (col1 = col3 AND col1 > 100 AND col2 < -50)
ALTER TABLE test3 ADD CONSTRAINT ch_in_test3 CHECK (col1 = col3 and col1 > 100 and col2 < -50)
ALTER TABLE test3 ADD CONSTRAINT fk_in_test3 FOREIGN KEY ( col3 ) REFERENCES othertable ( othercol ) ON DELETE NO ACTION
ALTER TABLE test1 ADD CONSTRAINT ch_in_test1 CHECK (col1 = col3 AND col1 > 100 AND col2 < -50)
ALTER TABLE test1 ADD CONSTRAINT ch_in_test1 CHECK (col1 = col3 and col1 > 100 and col2 < -50)
ALTER TABLE test1 ADD CONSTRAINT fk_in_test1 FOREIGN KEY ( col3 ) REFERENCES othertable ( othercol ) ON DELETE NO ACTION

== TEST 16 add check constraint via alter statement

ALTER TABLE test1 ADD CONSTRAINT ch_in_alter CHECK (col1 = col2 AND col1 > 100 AND col2 < -50)
ALTER TABLE test1 ADD CONSTRAINT ch_in_alter CHECK (col1 = col2 and col1 > 100 and col2 < -50)

== TEST 17 modify check constraint in table

ALTER TABLE test1 DROP CONSTRAINT ch_in_table
ALTER TABLE test1 ADD CONSTRAINT ch_in_table CHECK (col1 = col2 AND col1 > 200 AND col2 < -500)
ALTER TABLE test1 ADD CONSTRAINT ch_in_table CHECK (col1 = col2 and col1 > 200 and col2 < -500)

== TEST 18 modify check constraint via alter statement

ALTER TABLE test1 DROP CONSTRAINT ch_in_alter
ALTER TABLE test1 ADD CONSTRAINT ch_in_alter CHECK (col1 = col2 AND col1 > 200 AND col2 < -500)
ALTER TABLE test1 ADD CONSTRAINT ch_in_alter CHECK (col1 = col2 and col1 > 200 and col2 < -500)

== TEST 19 drop check constraint in table

Expand Down

0 comments on commit e3953b9

Please sign in to comment.