Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sql seed file #333

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions database/seed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ CREATE TABLE groups (

CREATE TABLE members (
id character varying PRIMARY KEY,
created_at timestamp without time zone NOT NULL DEFAULT now(),
group_id character varying(32) REFERENCES groups(id),
CONSTRAINT "UQ_db97b66d973228a2049c76f89e2" UNIQUE (id, group_id)
created_at timestamp without time zone NOT NULL DEFAULT now()
);

-- Table Definition ----------------------------------------------

CREATE TABLE memberships (
"group" character varying(32) REFERENCES groups(id),
member character varying REFERENCES members(id),
CONSTRAINT "PK_91a108ed26822c9aaf95c5ed30e" PRIMARY KEY ("group", member)
);

-- Table Definition ----------------------------------------------
Expand All @@ -54,3 +60,6 @@ ALTER TABLE "groups" ADD FOREIGN KEY ("admin_id") REFERENCES "admins" ("id");
ALTER TABLE "members" ADD FOREIGN KEY ("group_id") REFERENCES "groups" ("id");
ALTER TABLE "invites" ADD FOREIGN KEY ("group_id") REFERENCES "groups" ("id");
ALTER TABLE "oauth_accounts" ADD FOREIGN KEY ("group_id") REFERENCES "groups" ("id");

CREATE INDEX "IDX_98688b164e38f522c6b4ade701" ON memberships("group" text_ops);
CREATE INDEX "IDX_772286a3c5154724324fd55eaf" ON memberships(member text_ops);
Loading