-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
consider constraint doesn't exist in table schema
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...postgresql/src/testFixtures/resources/fixtures_postgresql/alter-table-drop-constraint/1.s
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CREATE TABLE test ( | ||
external_event_id TEXT | ||
); | ||
|
||
ALTER TABLE test | ||
ADD CONSTRAINT idx_external_event_id | ||
UNIQUE (external_event_id); | ||
|
||
CREATE TABLE t1 ( | ||
c1 INTEGER, | ||
t1 TEXT, | ||
t2 VARCHAR(255), | ||
t3 CHAR(10) | ||
); | ||
|
||
ALTER TABLE t1 | ||
ADD CONSTRAINT chk_c1 CHECK (c1 > 0), | ||
ADD CONSTRAINT chk_t2 CHECK (CHAR_LENGTH(t2) > 0); | ||
|
||
ALTER TABLE t1 | ||
DROP CONSTRAINT chk_c1; | ||
|
||
ALTER TABLE t1 | ||
DROP CONSTRAINT chk_t2 RESTRICT; | ||
|
||
ALTER TABLE test | ||
DROP CONSTRAINT IF EXISTS idx_external_event_id CASCADE; |