-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #391 from Keithcat767/test/many-to-many-cache-inva…
…lidation test: many-to-many revalidateRelations test
- Loading branch information
Showing
3 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
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
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
27 changes: 27 additions & 0 deletions
27
supabase/migrations/20240229212226_add_many_to_many_test_tables.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,27 @@ | ||
create table "public"."address_book" ( | ||
"id" uuid not null default gen_random_uuid(), | ||
"created_at" timestamp with time zone not null default now(), | ||
"name" character varying | ||
); | ||
|
||
|
||
create table "public"."address_book_contact" ( | ||
"contact" uuid not null, | ||
"address_book" uuid not null | ||
); | ||
|
||
CREATE UNIQUE INDEX address_book_contact_pkey ON public.address_book_contact USING btree (contact, address_book); | ||
|
||
CREATE UNIQUE INDEX address_book_pkey ON public.address_book USING btree (id); | ||
|
||
alter table "public"."address_book" add constraint "address_book_pkey" PRIMARY KEY using index "address_book_pkey"; | ||
|
||
alter table "public"."address_book_contact" add constraint "address_book_contact_pkey" PRIMARY KEY using index "address_book_contact_pkey"; | ||
|
||
alter table "public"."address_book_contact" add constraint "address_book_contact_address_book_fkey" FOREIGN KEY (address_book) REFERENCES address_book(id) on delete cascade not valid; | ||
|
||
alter table "public"."address_book_contact" validate constraint "address_book_contact_address_book_fkey"; | ||
|
||
alter table "public"."address_book_contact" add constraint "address_book_contact_contact_fkey" FOREIGN KEY (contact) REFERENCES contact(id) on delete cascade not valid; | ||
|
||
alter table "public"."address_book_contact" validate constraint "address_book_contact_contact_fkey"; |