17 lines
478 B
MySQL
17 lines
478 B
MySQL
|
CREATE TABLE "participation" (
|
||
|
"id" serial NOT NULL,
|
||
|
PRIMARY KEY ("id"),
|
||
|
"user_id" integer NOT NULL,
|
||
|
"event_id" integer NOT NULL,
|
||
|
"invited_by_user_id" integer NULL,
|
||
|
"created_at" date NOT NULL,
|
||
|
"updated_at" date NOT NULL
|
||
|
);
|
||
|
|
||
|
ALTER TABLE "participation"
|
||
|
ADD FOREIGN KEY ("event_id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||
|
|
||
|
ALTER TABLE "participation"
|
||
|
ADD FOREIGN KEY ("user_id") REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||
|
|