Skip to content

Commit

Permalink
testing constraint rendering fixes (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk authored Jun 2, 2023
1 parent 876076b commit 491611b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20230511-162623.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: test constraint rendering of foreign key and unique constraints
time: 2023-05-11T16:26:23.49096-04:00
custom:
Author: michelleark
Issue: "7417"
9 changes: 6 additions & 3 deletions tests/functional/adapter/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

_expected_sql_redshift = """
create table <model_identifier> (
id integer not null primary key,
id integer not null primary key references <foreign_key_model_identifier> (id) unique,
color text,
date_day text
) ;
Expand All @@ -23,6 +23,7 @@
color,
date_day from
(
-- depends_on: <foreign_key_model_identifier>
select
'blue' as color,
1 as id,
Expand Down Expand Up @@ -104,7 +105,8 @@ def expected_sql(self):
color text,
date_day text,
primary key (id),
constraint strange_uniqueness_requirement unique (color, date_day)
constraint strange_uniqueness_requirement unique (color, date_day),
foreign key (id) references <foreign_key_model_identifier> (id)
) ;
insert into <model_identifier>
(
Expand All @@ -113,9 +115,10 @@ def expected_sql(self):
color,
date_day from
(
-- depends_on: <foreign_key_model_identifier>
select
1 as id,
'blue' as color,
1 as id,
'2019-01-01' as date_day
) as model_subq
)
Expand Down

0 comments on commit 491611b

Please sign in to comment.