shellphone.app/db/migrations/20210801151308_web_push_subscriptions/migration.sql

17 lines
519 B
MySQL
Raw Normal View History

2021-08-01 16:28:47 +00:00
-- CreateTable
CREATE TABLE "NotificationSubscription" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMPTZ NOT NULL,
"endpoint" TEXT NOT NULL,
"expirationTime" INTEGER,
"keys_p256dh" TEXT NOT NULL,
"keys_auth" TEXT NOT NULL,
"customerId" TEXT NOT NULL,
PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "NotificationSubscription" ADD FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE CASCADE ON UPDATE CASCADE;