Skip to content

Commit 668dece

Browse files
committed
Remove deferrable unique constraint from factory and tests
1 parent 6cdde42 commit 668dece

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

tests/factories.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ def create_table_for_repacking(
6262
int_with_long_index_name INTEGER,
6363
var_with_unique_idx VARCHAR(10),
6464
var_with_unique_const VARCHAR(10) UNIQUE,
65-
var_with_deferrable_const VARCHAR(10),
66-
var_with_deferred_const VARCHAR(10),
6765
valid_fk INTEGER REFERENCES {schema}.referred_table(id),
6866
not_valid_fk INTEGER,
6967
{table_name} INTEGER,
@@ -115,20 +113,6 @@ def create_table_for_repacking(
115113
CHECK (int_with_not_valid_check >= 0) NOT VALID;
116114
""")
117115
)
118-
cur.execute(
119-
dedent(f"""
120-
ALTER TABLE {schema}.{table_name} ADD CONSTRAINT non_deferrable_const
121-
UNIQUE (var_with_deferrable_const)
122-
DEFERRABLE;
123-
""")
124-
)
125-
cur.execute(
126-
dedent(f"""
127-
ALTER TABLE {schema}.{table_name} ADD CONSTRAINT deferred_const
128-
UNIQUE (var_with_deferred_const)
129-
DEFERRABLE INITIALLY DEFERRED;
130-
""")
131-
)
132116
# Constraint for a column that has the same name as the table.
133117
cur.execute(
134118
dedent(f"""
@@ -156,8 +140,6 @@ def create_table_for_repacking(
156140
int_with_long_index_name,
157141
var_with_unique_idx,
158142
var_with_unique_const,
159-
var_with_deferrable_const,
160-
var_with_deferred_const,
161143
valid_fk,
162144
not_valid_fk,
163145
{table_name},
@@ -173,8 +155,6 @@ def create_table_for_repacking(
173155
(floor(random() * 10) + 1)::int,
174156
substring(md5(random()::text), 1, 10),
175157
substring(md5(random()::text), 1, 10),
176-
substring(md5(random()::text), 1, 10),
177-
substring(md5(random()::text), 1, 10),
178158
(floor(random() * {referred_table_rows}) + 1)::int,
179159
(floor(random() * {referred_table_rows}) + 1)::int,
180160
(floor(random() * 10) + 1)::int,

tests/test_repack.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,8 +1356,6 @@ def test_when_table_has_large_value_being_inserted(
13561356
int_with_long_index_name,
13571357
var_with_unique_idx,
13581358
var_with_unique_const,
1359-
var_with_deferrable_const,
1360-
var_with_deferred_const,
13611359
valid_fk,
13621360
not_valid_fk,
13631361
to_repack,
@@ -1372,8 +1370,6 @@ def test_when_table_has_large_value_being_inserted(
13721370
(floor(random() * 10) + 1)::int,
13731371
substring(md5(random()::text), 1, 10),
13741372
substring(md5(random()::text), 1, 10),
1375-
substring(md5(random()::text), 1, 10),
1376-
substring(md5(random()::text), 1, 10),
13771373
(floor(random() * 10) + 1)::int,
13781374
(floor(random() * 10) + 1)::int,
13791375
(floor(random() * 10) + 1)::int,

0 commit comments

Comments
 (0)