-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
11 additions
and
38 deletions.
There are no files selected for viewing
36 changes: 0 additions & 36 deletions
36
services/hasura/metadata/databases/default/tables/public_referrer_types.yaml
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 |
---|---|---|
@@ -1,39 +1,3 @@ | ||
table: | ||
name: referrer_types | ||
schema: public | ||
is_enum: true | ||
array_relationships: | ||
- name: consultations | ||
using: | ||
manual_configuration: | ||
column_mapping: | ||
referrer_type: referrer | ||
insertion_order: null | ||
remote_table: | ||
name: consultations | ||
schema: public | ||
select_permissions: | ||
- role: cohort | ||
permission: | ||
columns: | ||
- referrer_type | ||
filter: {} | ||
comment: "" | ||
- role: member | ||
permission: | ||
columns: | ||
- referrer_type | ||
filter: {} | ||
comment: "" | ||
- role: public | ||
permission: | ||
columns: | ||
- referrer_type | ||
filter: {} | ||
comment: "" | ||
- role: user | ||
permission: | ||
columns: | ||
- referrer_type | ||
filter: {} | ||
comment: "" |
2 changes: 1 addition & 1 deletion
2
services/hasura/migrations/default/1708519418394_create_table_referrer_types/up.sql
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
CREATE TABLE "public"."referrer_types" ( | ||
"referrer_type" text NOT NULL, | ||
"referrer_type" TEXT NOT NULL, | ||
PRIMARY KEY ("referrer_type") | ||
); |
2 changes: 1 addition & 1 deletion
2
...ura/migrations/default/1708519463849_alter_table_consultations_add_column_referrer/up.sql
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
ALTER TABLE consultations | ||
ADD COLUMN referrer referrer_types DEFAULT NULL; | ||
ADD COLUMN referrer TEXT DEFAULT NULL; |
Empty file.
9 changes: 9 additions & 0 deletions
9
.../hasura/migrations/default/1708605869089_set_fk_public_consultations_referrer_type/up.sql
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,9 @@ | ||
-- First, drop the existing constraint if it exists | ||
ALTER TABLE public.consultations | ||
DROP CONSTRAINT IF EXISTS "fk_consultations_referrer"; | ||
|
||
-- Then, add the foreign key constraint | ||
ALTER TABLE public.consultations | ||
ADD CONSTRAINT "fk_consultations_referrer" | ||
FOREIGN KEY ("referrer") | ||
REFERENCES public.referrer_types(referrer_type); |