9 lines
459 B
SQL
9 lines
459 B
SQL
CREATE TABLE "announcements" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"message" text NOT NULL,
|
|
"event_date" date NOT NULL,
|
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
"created_by_user_id" uuid
|
|
);
|
|
--> statement-breakpoint
|
|
ALTER TABLE "announcements" ADD CONSTRAINT "announcements_created_by_user_id_user_id_fk" FOREIGN KEY ("created_by_user_id") REFERENCES "public"."user"("id") ON DELETE restrict ON UPDATE no action; |