10 lines
572 B
SQL
10 lines
572 B
SQL
CREATE TABLE "comments"."push_subscription" (
|
|
"endpoint" text PRIMARY KEY NOT NULL,
|
|
"user_id" text NOT NULL,
|
|
"p256dh" text NOT NULL,
|
|
"auth" text NOT NULL,
|
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
ALTER TABLE "comments"."push_subscription" ADD CONSTRAINT "push_subscription_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "auth"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
CREATE INDEX "comment_push_subscription_user_idx" ON "comments"."push_subscription" USING btree ("user_id"); |