Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
schema update
Ashish Viradiya0cb076f0a238
diff --git a/prisma/migrations/20250805171352_added_slack_notification/migration.sql b/prisma/migrations/20250805171352_added_slack_notification/migration.sqldeleted file mode 100644index be77888a..00000000--- a/prisma/migrations/20250805171352_added_slack_notification/migration.sql+++ /dev/null@@ -1,69 +0,0 @@--- CreateTable-CREATE TABLE "SlackIntegration" (- "id" TEXT NOT NULL,- "teamId" TEXT NOT NULL,- "workspaceId" TEXT NOT NULL,- "workspaceName" TEXT NOT NULL,- "workspaceUrl" TEXT NOT NULL,- "accessToken" TEXT NOT NULL,- "botUserId" TEXT NOT NULL,- "botUsername" TEXT NOT NULL,- "defaultChannel" TEXT,- "enabledChannels" JSONB NOT NULL,- "enabled" BOOLEAN NOT NULL DEFAULT true,- "notificationTypes" JSONB NOT NULL,- "frequency" TEXT NOT NULL DEFAULT 'instant',- "timezone" TEXT NOT NULL DEFAULT 'UTC',- "dailyTime" TEXT DEFAULT '10:00',- "weeklyDay" TEXT,- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,- "updatedAt" TIMESTAMP(3) NOT NULL,-- CONSTRAINT "SlackIntegration_pkey" PRIMARY KEY ("id")-);---- CreateTable-CREATE TABLE "SlackNotification" (- "id" TEXT NOT NULL,- "teamId" TEXT NOT NULL,- "slackIntegrationId" TEXT NOT NULL,- "eventType" TEXT NOT NULL,- "eventData" JSONB NOT NULL,- "status" TEXT NOT NULL DEFAULT 'PENDING',- "scheduledFor" TIMESTAMP(3) NOT NULL,- "processedAt" TIMESTAMP(3),- "errorMessage" TEXT,- "retryCount" INTEGER NOT NULL DEFAULT 0,- "maxRetries" INTEGER NOT NULL DEFAULT 3,- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,- "updatedAt" TIMESTAMP(3) NOT NULL,-- CONSTRAINT "SlackNotification_pkey" PRIMARY KEY ("id")-);---- CreateIndex-CREATE INDEX "SlackIntegration_teamId_idx" ON "SlackIntegration"("teamId");---- CreateIndex-CREATE UNIQUE INDEX "SlackIntegration_teamId_key" ON "SlackIntegration"("teamId");---- CreateIndex-CREATE INDEX "SlackNotification_teamId_idx" ON "SlackNotification"("teamId");---- CreateIndex-CREATE INDEX "SlackNotification_slackIntegrationId_idx" ON "SlackNotification"("slackIntegrationId");---- CreateIndex-CREATE INDEX "SlackNotification_status_scheduledFor_idx" ON "SlackNotification"("status", "scheduledFor");---- CreateIndex-CREATE INDEX "SlackNotification_createdAt_idx" ON "SlackNotification"("createdAt");---- AddForeignKey-ALTER TABLE "SlackIntegration" ADD CONSTRAINT "SlackIntegration_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE;---- AddForeignKey-ALTER TABLE "SlackNotification" ADD CONSTRAINT "SlackNotification_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE;---- AddForeignKey-ALTER TABLE "SlackNotification" ADD CONSTRAINT "SlackNotification_slackIntegrationId_fkey" FOREIGN KEY ("slackIntegrationId") REFERENCES "SlackIntegration"("id") ON DELETE CASCADE ON UPDATE CASCADE;diff --git a/prisma/migrations/20250904040013_slack_integration/migration.sql b/prisma/migrations/20250904040013_slack_integration/migration.sqlnew file mode 100644index 00000000..7d131e1d--- /dev/null+++ b/prisma/migrations/20250904040013_slack_integration/migration.sql@@ -0,0 +1,28 @@+-- CreateTable+CREATE TABLE "SlackIntegration" (+ "id" TEXT NOT NULL,+ "teamId" TEXT NOT NULL,+ "workspaceId" TEXT NOT NULL,+ "workspaceName" TEXT NOT NULL,+ "workspaceUrl" TEXT NOT NULL,+ "accessToken" TEXT NOT NULL,+ "botUserId" TEXT NOT NULL,+ "botUsername" TEXT NOT NULL,+ "defaultChannel" TEXT,+ "enabledChannels" JSONB NOT NULL,+ "enabled" BOOLEAN NOT NULL DEFAULT true,+ "notificationTypes" JSONB NOT NULL,+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" TIMESTAMP(3) NOT NULL,++ CONSTRAINT "SlackIntegration_pkey" PRIMARY KEY ("id")+);++-- CreateIndex+CREATE INDEX "SlackIntegration_teamId_idx" ON "SlackIntegration"("teamId");++-- CreateIndex+CREATE UNIQUE INDEX "SlackIntegration_teamId_key" ON "SlackIntegration"("teamId");++-- AddForeignKey+ALTER TABLE "SlackIntegration" ADD CONSTRAINT "SlackIntegration_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE;diff --git a/prisma/schema/schema.prisma b/prisma/schema/schema.prismaindex 5df6ad1d..c57d3cd4 100644--- a/prisma/schema/schema.prisma+++ b/prisma/schema/schema.prisma@@ -588,45 +588,11 @@ model SlackIntegration {defaultChannel String? // Default channel for notificationsenabledChannels Json // { "channel_id": { "name": "channel-name", "enabled": true } }enabled Boolean @default(true)- notificationTypes Json // { "document_view": true, "dataroom_access": true, "document_download": true, "document_reaction": true }- frequency String @default("instant") // "instant", "daily", "weekly"- timezone String @default("UTC")- dailyTime String? @default("10:00")- weeklyDay String?+ notificationTypes Json // { "document_view": true, "dataroom_access": true, "document_download": true }createdAt DateTime @default(now())updatedAt DateTime @updatedAt- notifications SlackNotification[]-@@unique([teamId])@@index([teamId])}--model SlackNotification {- id String @id @default(cuid())- teamId String- team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)- slackIntegrationId String- slackIntegration SlackIntegration @relation(fields: [slackIntegrationId], references: [id], onDelete: Cascade)-- // Event Details- eventType String // "document_view", "dataroom_access", "document_download", "document_reaction"- eventData Json // Complete event data for processing-- // Status- status String @default("PENDING") // "PENDING", "PROCESSED", "FAILED"- scheduledFor DateTime // When to process this notification- processedAt DateTime?- errorMessage String?- retryCount Int @default(0)- maxRetries Int @default(3)-- createdAt DateTime @default(now())- updatedAt DateTime @updatedAt-- @@index([teamId])- @@index([slackIntegrationId])- @@index([status, scheduledFor])- @@index([createdAt])-}diff --git a/prisma/schema/team.prisma b/prisma/schema/team.prismaindex 4ecaabe9..117e7889 100644--- a/prisma/schema/team.prisma+++ b/prisma/schema/team.prisma@@ -23,7 +23,6 @@ model Team {uploadedDocuments DocumentUpload[]Tag Tag[]slackIntegration SlackIntegration?- slackNotifications SlackNotification[]links Link[]views View[]