mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Prevents a fatal error when running migrations on vanilla PostgreSQL instance without the pg_uuidv7 extension
15 lines
636 B
SQL
15 lines
636 B
SQL
CREATE TABLE "PushSubscriptions" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"endpoint" text NOT NULL,
|
|
"public_key" text NOT NULL,
|
|
"auth_secret" text NOT NULL,
|
|
"alerts" jsonb NOT NULL,
|
|
"policy" text NOT NULL,
|
|
"created_at" timestamp(3) DEFAULT now() NOT NULL,
|
|
"updated_at" timestamp(3) DEFAULT now() NOT NULL,
|
|
"tokenId" uuid NOT NULL,
|
|
CONSTRAINT "PushSubscriptions_tokenId_unique" UNIQUE("tokenId")
|
|
);
|
|
--> statement-breakpoint
|
|
ALTER TABLE "PushSubscriptions" ADD CONSTRAINT "PushSubscriptions_tokenId_Tokens_id_fk" FOREIGN KEY ("tokenId") REFERENCES "public"."Tokens"("id") ON DELETE cascade ON UPDATE cascade;
|