Skip to content

Commit

Permalink
Fixture test
Browse files Browse the repository at this point in the history
consider constraint doesn't exist in table schema
  • Loading branch information
griffio committed Jun 7, 2024
1 parent 15e6ad1 commit 8f115eb
Showing 1 changed file with 27 additions and 0 deletions.
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;

0 comments on commit 8f115eb

Please sign in to comment.