feat: add monitoring alert read state
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE "InfrastructureAlertRead" (
|
||||
"id" TEXT NOT NULL,
|
||||
"fingerprint" TEXT NOT NULL,
|
||||
"activeAt" TIMESTAMP(3) NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"readAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
CONSTRAINT "InfrastructureAlertRead_pkey" PRIMARY KEY ("id"),
|
||||
CONSTRAINT "InfrastructureAlertRead_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX "InfrastructureAlertRead_fingerprint_userId_key"
|
||||
ON "InfrastructureAlertRead"("fingerprint", "userId");
|
||||
|
||||
CREATE INDEX "InfrastructureAlertRead_userId_readAt_idx"
|
||||
ON "InfrastructureAlertRead"("userId", "readAt");
|
||||
Reference in New Issue
Block a user