From 8103716ae4c34546058772990721fca352278f6a Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 20 Feb 2024 18:03:01 +0100 Subject: [PATCH] feat: bump document drive --- api/package.json | 2 +- api/pnpm-lock.yaml | 8 ++++---- api/prisma/schema.prisma | 19 +++++++------------ 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/api/package.json b/api/package.json index 1462eb7a..40235aba 100644 --- a/api/package.json +++ b/api/package.json @@ -21,7 +21,7 @@ "body-parser": "^1.20.2", "cookie-parser": "^1.4.6", "cors": "^2.8.5", - "document-drive": "^1.0.0-alpha.3", + "document-drive": "^1.0.0-alpha.5", "document-model": "^1.0.30", "document-model-libs": "^1.1.51", "dotenv": "^16.0.3", diff --git a/api/pnpm-lock.yaml b/api/pnpm-lock.yaml index 794c8250..4f706971 100644 --- a/api/pnpm-lock.yaml +++ b/api/pnpm-lock.yaml @@ -24,8 +24,8 @@ dependencies: specifier: ^2.8.5 version: 2.8.5 document-drive: - specifier: ^1.0.0-alpha.3 - version: 1.0.0-alpha.3(@prisma/client@5.8.1)(document-model-libs@1.1.51)(document-model@1.0.30)(localforage@1.10.0)(sequelize@6.37.0)(sqlite3@5.1.7) + specifier: ^1.0.0-alpha.5 + version: 1.0.0-alpha.5(@prisma/client@5.8.1)(document-model-libs@1.1.51)(document-model@1.0.30)(localforage@1.10.0)(sequelize@6.37.0)(sqlite3@5.1.7) document-model: specifier: ^1.0.30 version: 1.0.30 @@ -4425,8 +4425,8 @@ packages: esutils: 2.0.3 dev: true - /document-drive@1.0.0-alpha.3(@prisma/client@5.8.1)(document-model-libs@1.1.51)(document-model@1.0.30)(localforage@1.10.0)(sequelize@6.37.0)(sqlite3@5.1.7): - resolution: {integrity: sha512-y7JqumZ8uAceocSLDAkCESgeVart0sbbJpGYQr9rs+EcnvFl0hXX4bfNOnuVe9Ns51GV2+qrq0vHKLt1mh50jQ==} + /document-drive@1.0.0-alpha.5(@prisma/client@5.8.1)(document-model-libs@1.1.51)(document-model@1.0.30)(localforage@1.10.0)(sequelize@6.37.0)(sqlite3@5.1.7): + resolution: {integrity: sha512-0dx7+dcA9F2SYBsD3XLv0TA5awKDm7i7Areu2uw5ZBdJ7Ro/XGR7YDQhbsoZHjf9EkEq/VlRw9az4IKiGGUEsw==} peerDependencies: '@prisma/client': 5.8.1 document-model: ^1.0.29 diff --git a/api/prisma/schema.prisma b/api/prisma/schema.prisma index 622beb74..6fc3882f 100644 --- a/api/prisma/schema.prisma +++ b/api/prisma/schema.prisma @@ -65,8 +65,9 @@ model Document { } model Operation { + id String @id @default(uuid()) driveId String - Document Document? @relation(fields: [driveId, documentId], references: [driveId, id]) + Document Document? @relation(fields: [driveId, documentId], references: [driveId, id], onDelete: Cascade) documentId String scope String branch String @@ -80,9 +81,7 @@ model Operation { syncId String? clipboard Boolean? @default(false) - SyncronizationUnit SyncronizationUnit? @relation(fields: [syncId, driveId], references: [id, driveId]) - - @@id([driveId, documentId, scope, branch, index]) + SyncronizationUnit SyncronizationUnit? @relation(fields: [syncId, driveId], references: [id, driveId], onDelete: Cascade) } model SyncronizationUnit { @@ -90,7 +89,7 @@ model SyncronizationUnit { driveId String documentId String - Document Document @relation(fields: [documentId, driveId], references: [id, driveId]) + Document Document @relation(fields: [documentId, driveId], references: [id, driveId], onDelete: Cascade) scope String branch String operations Operation[] @@ -99,13 +98,9 @@ model SyncronizationUnit { } model Attachment { - id String @id @default(uuid()) - driveId String - documentId String - scope String - branch String - index Int - Operation Operation @relation(fields: [driveId, documentId, scope, branch, index], references: [driveId, documentId, scope, branch, index], onDelete: Cascade) + id String @id @default(uuid()) + operationId String + Operation Operation @relation(fields: [operationId], references: [id], onDelete: Cascade) mimeType String data String