Docker-ready Next.js + Prisma/Postgres e-invitation app: themed invite pages, RSVP, comments, share links, email + SMS invites with reply-to-RSVP-by-text, co-hosts, photo dropbox, and browser push notifications.
22 lines
687 B
SQL
22 lines
687 B
SQL
-- CreateTable
|
|
CREATE TABLE "PushSubscription" (
|
|
"id" TEXT NOT NULL,
|
|
"userId" TEXT NOT NULL,
|
|
"endpoint" TEXT NOT NULL,
|
|
"p256dh" TEXT NOT NULL,
|
|
"auth" TEXT NOT NULL,
|
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
CONSTRAINT "PushSubscription_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- CreateIndex
|
|
CREATE UNIQUE INDEX "PushSubscription_endpoint_key" ON "PushSubscription"("endpoint");
|
|
|
|
-- CreateIndex
|
|
CREATE INDEX "PushSubscription_userId_idx" ON "PushSubscription"("userId");
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "PushSubscription" ADD CONSTRAINT "PushSubscription_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|