Skip to content

Commit

Permalink
move faq table
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley committed Jan 14, 2024
1 parent fd4f39b commit b30514f
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions backend/migrations/000001_init.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,25 @@ CREATE TABLE IF NOT EXISTS contact (
ON DELETE CASCADE
);

CREATE TABLE IF NOT EXISTS faq (
id UUID NOT NULL PRIMARY KEY,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),

created_by UUID NOT NULL REFERENCES sac_user (id),
question VARCHAR(255) NOT NULL,

answered_by UUID REFERENCES sac_user (id),
answer VARCHAR(255),
num_found_helpful INT,

club_id UUID NOT NULL REFERENCES club (id),

CONSTRAINT fk_club
FOREIGN KEY (club_id)
REFERENCES club (id)
ON DELETE CASCADE
);

CREATE TABLE IF NOT EXISTS tag (
id UUID NOT NULL PRIMARY KEY,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
Expand Down Expand Up @@ -235,25 +254,6 @@ CREATE TABLE IF NOT EXISTS follower (
ON DELETE CASCADE
);

CREATE TABLE IF NOT EXISTS faq (
id UUID NOT NULL PRIMARY KEY,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),

created_by UUID NOT NULL REFERENCES sac_user (id),
question VARCHAR(255) NOT NULL,

answered_by UUID REFERENCES sac_user (id),
answer VARCHAR(255),
num_found_helpful INT,

club_id UUID NOT NULL REFERENCES club (id),

CONSTRAINT fk_club
FOREIGN KEY (club_id)
REFERENCES club (id)
ON DELETE CASCADE
);

-- Club <-> Tag Bridge

CREATE TABLE IF NOT EXISTS club_tag (
Expand Down

0 comments on commit b30514f

Please sign in to comment.