Add on delete cascade to signups user_id column

This commit is contained in:
Max Brunsfeld 2022-09-20 16:12:27 -07:00
parent 1877fc234b
commit 758875305b
2 changed files with 2 additions and 3 deletions

View file

@ -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;

View file

@ -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,