From 758875305b09c03ab47a712c28596feeaf91c0ad Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 20 Sep 2022 16:12:27 -0700 Subject: [PATCH] Add on delete cascade to signups user_id column --- .../collab/migrations/20220913211150_create_signups.down.sql | 1 - crates/collab/migrations/20220913211150_create_signups.up.sql | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/collab/migrations/20220913211150_create_signups.down.sql b/crates/collab/migrations/20220913211150_create_signups.down.sql index ec02ac3322..59b20b1128 100644 --- a/crates/collab/migrations/20220913211150_create_signups.down.sql +++ b/crates/collab/migrations/20220913211150_create_signups.down.sql @@ -7,4 +7,3 @@ ALTER TABLE users DROP SEQUENCE metrics_id_seq; DROP INDEX index_users_on_email_address; -DROP INDEX index_users_on_github_user_id; \ No newline at end of file diff --git a/crates/collab/migrations/20220913211150_create_signups.up.sql b/crates/collab/migrations/20220913211150_create_signups.up.sql index 3de683c58e..5f02bd6887 100644 --- a/crates/collab/migrations/20220913211150_create_signups.up.sql +++ b/crates/collab/migrations/20220913211150_create_signups.up.sql @@ -7,8 +7,8 @@ CREATE TABLE IF NOT EXISTS "signups" ( "email_confirmation_sent" BOOLEAN NOT NULL, "metrics_id" INTEGER NOT NULL DEFAULT nextval('metrics_id_seq'), "created_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - "user_id" INTEGER REFERENCES users (id), - "inviting_user_id" INTEGER REFERENCES users (id), + "user_id" INTEGER REFERENCES users (id) ON DELETE CASCADE, + "inviting_user_id" INTEGER REFERENCES users (id) ON DELETE SET NULL, "platform_mac" BOOLEAN NOT NULL, "platform_linux" BOOLEAN NOT NULL,