Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: add migration

Marc Seitz3add8a38a124
diff --git a/prisma/migrations/20240916000000_add_content_type_to_document/migration.sql b/prisma/migrations/20240916000000_add_content_type_to_document/migration.sql
new file mode 100644
index 00000000..9a61e5c6
--- /dev/null
+++ b/prisma/migrations/20240916000000_add_content_type_to_document/migration.sql
@@ -0,0 +1,8 @@
+-- AlterTable
+ALTER TABLE "Document" ADD COLUMN "contentType" TEXT,
+ADD COLUMN "originalFile" TEXT;
+
+-- AlterTable
+ALTER TABLE "DocumentVersion" ADD COLUMN "contentType" TEXT,
+ADD COLUMN "originalFile" TEXT;
+
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index a0c08b71..c7792b26 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -129,7 +129,9 @@ model Document {
name String
description String?
file String // This should be a reference to where the file is stored (S3, Google Cloud Storage, etc.)
+ originalFile String? // This should be a reference to the original file like pptx, xlsx, etc. (S3, Google Cloud Storage, etc.)
type String? // This should be a reference to the file type (pdf, sheet, etc.)
+ contentType String? // This should be the actual contentType of the file like application/pdf, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, etc.
storageType DocumentStorageType @default(VERCEL_BLOB)
numPages Int? // This should be a reference to the number of pages in the document
owner User? @relation(fields: [ownerId], references: [id], onDelete: SetNull)
@@ -161,7 +163,9 @@ model DocumentVersion {
document Document @relation(fields: [documentId], references: [id], onDelete: Cascade)
documentId String
file String // This should be a reference to where the file is stored (S3, Google Cloud Storage, etc.)
+ originalFile String? // This should be a reference to the original file like pptx, xlsx, etc. (S3, Google Cloud Storage, etc.)
type String? // This should be a reference to the file type (pdf, docx, etc.)
+ contentType String? // This should be the actual contentType of the file like application/pdf, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, etc.
storageType DocumentStorageType @default(VERCEL_BLOB)
numPages Int? // This should be a reference to the number of pages in the document
isPrimary Boolean @default(false) // Indicates if this is the primary version