Skip to content

Commit

Permalink
Merge pull request #333 from privacy-scaling-explorations/update-seed
Browse files Browse the repository at this point in the history
Update sql seed file
  • Loading branch information
vplasencia authored Nov 13, 2023
2 parents e2e1697 + 985f02e commit f149dde
Showing 1 changed file with 12 additions and 3 deletions.
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);

0 comments on commit f149dde

Please sign in to comment.