create-prenta 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# create-actuate-cms
|
|
2
2
|
|
|
3
|
+
## 1.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 21acc95: `prenta db:sync` keeps host-only Prisma models instead of wiping them, and cms-core now ships the collab comment/CRDT/notification tables it already queries (#729). Admin `--font-sans` is system-ui until a shipped face exists. Release requests OIDC (`id-token: write`) and npm provenance for trusted publishing (#781).
|
|
8
|
+
|
|
3
9
|
## 1.4.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
-- Collab / comments / notifications models that cms-core already queries
|
|
2
|
+
-- (#729). Hosts that declared these by hand keep their data; IF NOT EXISTS
|
|
3
|
+
-- lets migrate deploy succeed when the unmapped tables already exist under
|
|
4
|
+
-- Prisma's default names — those hosts should rename onto the prenta_* maps
|
|
5
|
+
-- in a follow-up if they still use the old names.
|
|
6
|
+
|
|
7
|
+
CREATE TABLE IF NOT EXISTS "prenta_document_crdts" (
|
|
8
|
+
"documentId" TEXT NOT NULL,
|
|
9
|
+
"state" BYTEA NOT NULL,
|
|
10
|
+
"stateVector" BYTEA NOT NULL,
|
|
11
|
+
"version" INTEGER NOT NULL DEFAULT 0,
|
|
12
|
+
"lastUpdatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
13
|
+
"lastUpdatedById" TEXT,
|
|
14
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
15
|
+
|
|
16
|
+
CONSTRAINT "prenta_document_crdts_pkey" PRIMARY KEY ("documentId")
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
CREATE INDEX IF NOT EXISTS "prenta_document_crdts_lastUpdatedAt_idx" ON "prenta_document_crdts"("lastUpdatedAt");
|
|
20
|
+
|
|
21
|
+
CREATE TABLE IF NOT EXISTS "prenta_document_comments" (
|
|
22
|
+
"id" TEXT NOT NULL,
|
|
23
|
+
"documentId" TEXT NOT NULL,
|
|
24
|
+
"parentId" TEXT,
|
|
25
|
+
"userId" TEXT,
|
|
26
|
+
"body" TEXT NOT NULL,
|
|
27
|
+
"anchor" JSONB,
|
|
28
|
+
"resolvedAt" TIMESTAMP(3),
|
|
29
|
+
"resolvedById" TEXT,
|
|
30
|
+
"deletedAt" TIMESTAMP(3),
|
|
31
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
32
|
+
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
33
|
+
|
|
34
|
+
CONSTRAINT "prenta_document_comments_pkey" PRIMARY KEY ("id")
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
CREATE INDEX IF NOT EXISTS "prenta_document_comments_documentId_idx" ON "prenta_document_comments"("documentId");
|
|
38
|
+
CREATE INDEX IF NOT EXISTS "prenta_document_comments_documentId_resolvedAt_idx" ON "prenta_document_comments"("documentId", "resolvedAt");
|
|
39
|
+
CREATE INDEX IF NOT EXISTS "prenta_document_comments_parentId_idx" ON "prenta_document_comments"("parentId");
|
|
40
|
+
CREATE INDEX IF NOT EXISTS "prenta_document_comments_userId_idx" ON "prenta_document_comments"("userId");
|
|
41
|
+
CREATE INDEX IF NOT EXISTS "prenta_document_comments_createdAt_idx" ON "prenta_document_comments"("createdAt");
|
|
42
|
+
|
|
43
|
+
ALTER TABLE "prenta_document_comments" DROP CONSTRAINT IF EXISTS "prenta_document_comments_parentId_fkey";
|
|
44
|
+
ALTER TABLE "prenta_document_comments" ADD CONSTRAINT "prenta_document_comments_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "prenta_document_comments"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
45
|
+
|
|
46
|
+
ALTER TABLE "prenta_document_comments" DROP CONSTRAINT IF EXISTS "prenta_document_comments_userId_fkey";
|
|
47
|
+
ALTER TABLE "prenta_document_comments" ADD CONSTRAINT "prenta_document_comments_userId_fkey" FOREIGN KEY ("userId") REFERENCES "prenta_users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
48
|
+
|
|
49
|
+
CREATE TABLE IF NOT EXISTS "prenta_document_notifications" (
|
|
50
|
+
"id" TEXT NOT NULL,
|
|
51
|
+
"userId" TEXT NOT NULL,
|
|
52
|
+
"kind" TEXT NOT NULL,
|
|
53
|
+
"documentId" TEXT,
|
|
54
|
+
"commentId" TEXT,
|
|
55
|
+
"payload" JSONB NOT NULL,
|
|
56
|
+
"readAt" TIMESTAMP(3),
|
|
57
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
58
|
+
|
|
59
|
+
CONSTRAINT "prenta_document_notifications_pkey" PRIMARY KEY ("id")
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
CREATE INDEX IF NOT EXISTS "prenta_document_notifications_userId_readAt_idx" ON "prenta_document_notifications"("userId", "readAt");
|
|
63
|
+
CREATE INDEX IF NOT EXISTS "prenta_document_notifications_userId_createdAt_idx" ON "prenta_document_notifications"("userId", "createdAt");
|
|
64
|
+
CREATE INDEX IF NOT EXISTS "prenta_document_notifications_documentId_idx" ON "prenta_document_notifications"("documentId");
|
|
65
|
+
CREATE INDEX IF NOT EXISTS "prenta_document_notifications_commentId_idx" ON "prenta_document_notifications"("commentId");
|
|
66
|
+
|
|
67
|
+
ALTER TABLE "prenta_document_notifications" DROP CONSTRAINT IF EXISTS "prenta_document_notifications_userId_fkey";
|
|
68
|
+
ALTER TABLE "prenta_document_notifications" ADD CONSTRAINT "prenta_document_notifications_userId_fkey" FOREIGN KEY ("userId") REFERENCES "prenta_users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
@@ -119,11 +119,13 @@ model User {
|
|
|
119
119
|
updatedDocuments Document[] @relation("UpdatedDocuments")
|
|
120
120
|
versions Version[]
|
|
121
121
|
media Media[]
|
|
122
|
-
contentLocks
|
|
123
|
-
notifications
|
|
124
|
-
contentTemplates
|
|
125
|
-
workflowAssigned
|
|
126
|
-
passwordResetTokens
|
|
122
|
+
contentLocks ContentLock[]
|
|
123
|
+
notifications InAppNotification[]
|
|
124
|
+
contentTemplates ContentTemplate[]
|
|
125
|
+
workflowAssigned WorkflowState[]
|
|
126
|
+
passwordResetTokens PasswordResetToken[]
|
|
127
|
+
documentComments DocumentComment[]
|
|
128
|
+
documentNotifications DocumentNotification[]
|
|
127
129
|
|
|
128
130
|
@@map("prenta_users")
|
|
129
131
|
}
|
|
@@ -987,3 +989,62 @@ model ContentIssue {
|
|
|
987
989
|
@@index([documentId])
|
|
988
990
|
@@map("prenta_content_issues")
|
|
989
991
|
}
|
|
992
|
+
|
|
993
|
+
/// Persisted Yjs state for a document (`@prenta/realtime`). Optional: empty
|
|
994
|
+
/// when collaboration is unused. Cms-core queries this from `/realtime/sync`.
|
|
995
|
+
model DocumentCRDT {
|
|
996
|
+
documentId String @id
|
|
997
|
+
state Bytes
|
|
998
|
+
stateVector Bytes
|
|
999
|
+
version Int @default(0)
|
|
1000
|
+
lastUpdatedAt DateTime @default(now()) @updatedAt
|
|
1001
|
+
lastUpdatedById String?
|
|
1002
|
+
createdAt DateTime @default(now())
|
|
1003
|
+
|
|
1004
|
+
@@index([lastUpdatedAt])
|
|
1005
|
+
@@map("prenta_document_crdts")
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
/// Threaded inline comment. Soft-deletes keep replies attached. Optional.
|
|
1009
|
+
model DocumentComment {
|
|
1010
|
+
id String @id @default(cuid())
|
|
1011
|
+
documentId String
|
|
1012
|
+
parentId String?
|
|
1013
|
+
parent DocumentComment? @relation("CommentThread", fields: [parentId], references: [id], onDelete: Cascade)
|
|
1014
|
+
replies DocumentComment[] @relation("CommentThread")
|
|
1015
|
+
userId String?
|
|
1016
|
+
user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
|
|
1017
|
+
body String @db.Text
|
|
1018
|
+
anchor Json?
|
|
1019
|
+
resolvedAt DateTime?
|
|
1020
|
+
resolvedById String?
|
|
1021
|
+
deletedAt DateTime?
|
|
1022
|
+
createdAt DateTime @default(now())
|
|
1023
|
+
updatedAt DateTime @updatedAt
|
|
1024
|
+
|
|
1025
|
+
@@index([documentId])
|
|
1026
|
+
@@index([documentId, resolvedAt])
|
|
1027
|
+
@@index([parentId])
|
|
1028
|
+
@@index([userId])
|
|
1029
|
+
@@index([createdAt])
|
|
1030
|
+
@@map("prenta_document_comments")
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/// Per-user notification feed for collaboration events.
|
|
1034
|
+
model DocumentNotification {
|
|
1035
|
+
id String @id @default(cuid())
|
|
1036
|
+
userId String
|
|
1037
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
1038
|
+
kind String
|
|
1039
|
+
documentId String?
|
|
1040
|
+
commentId String?
|
|
1041
|
+
payload Json
|
|
1042
|
+
readAt DateTime?
|
|
1043
|
+
createdAt DateTime @default(now())
|
|
1044
|
+
|
|
1045
|
+
@@index([userId, readAt])
|
|
1046
|
+
@@index([userId, createdAt])
|
|
1047
|
+
@@index([documentId])
|
|
1048
|
+
@@index([commentId])
|
|
1049
|
+
@@map("prenta_document_notifications")
|
|
1050
|
+
}
|