diff --git a/postgres/init.sql b/postgres/init.sql index f1eca21..f4132ef 100644 --- a/postgres/init.sql +++ b/postgres/init.sql @@ -22,14 +22,14 @@ CREATE TABLE startup ( description text, city text NOT NULL, state text NOT NULL, + created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id) ); CREATE TABLE startup_membership ( - id uuid UNIQUE NOT NULL DEFAULT uuidv7(), - user_id uuid REFERENCES user_account(id), - startup_id uuid REFERENCES startup(id), - PRIMARY KEY (id) + user_id uuid REFERENCES user_account(id) ON DELETE CASCADE, + startup_id uuid REFERENCES startup(id) ON DELETE CASCADE, + PRIMARY KEY (user_id, startup_id) ); CREATE TYPE investor_kind AS enum (