schema.prisma 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. generator client {
  2. provider = "prisma-client"
  3. output = "../src/generated/prisma"
  4. }
  5. datasource db {
  6. provider = "mongodb"
  7. url = env("MONGO_URI")
  8. }
  9. type ActivitiesSnapshot {
  10. id String @map("_id") @db.ObjectId
  11. username String
  12. }
  13. type AiassistantsGrantedGroupsForAccessScope {
  14. /// Field referred in an index, but found no data to define the type.
  15. item Json?
  16. }
  17. type AiassistantsGrantedGroupsForShareScope {
  18. /// Field referred in an index, but found no data to define the type.
  19. item Json?
  20. }
  21. type PageoperationsExPage {
  22. /// Field referred in an index, but found no data to define the type.
  23. id Json? @map("_id")
  24. /// Field referred in an index, but found no data to define the type.
  25. path Json?
  26. }
  27. type PageoperationsPage {
  28. /// Field referred in an index, but found no data to define the type.
  29. id Json? @map("_id")
  30. /// Field referred in an index, but found no data to define the type.
  31. path Json?
  32. }
  33. type PagesGrantedGroups {
  34. /// Field referred in an index, but found no data to define the type.
  35. item Json?
  36. }
  37. model accesstokens {
  38. id String @id @default(auto()) @map("_id") @db.ObjectId
  39. /// Field referred in an index, but found no data to define the type.
  40. expiredAt Json?
  41. /// Field referred in an index, but found no data to define the type.
  42. tokenHash Json? @unique(map: "tokenHash_1")
  43. @@index([expiredAt], map: "expiredAt_1")
  44. }
  45. model activities {
  46. id String @id @default(auto()) @map("_id") @db.ObjectId
  47. v Int @map("__v")
  48. action String
  49. createdAt DateTime @db.Date
  50. endpoint String
  51. ip String
  52. snapshot ActivitiesSnapshot
  53. target String? @db.ObjectId
  54. targetModel String?
  55. user String? @db.ObjectId
  56. @@unique([user, target, action, createdAt], map: "user_1_target_1_action_1_createdAt_1")
  57. @@index([user], map: "user_1")
  58. @@index([snapshot.username], map: "snapshot.username_1")
  59. @@index([target, action], map: "target_1_action_1")
  60. @@index([createdAt], map: "createdAt_1")
  61. }
  62. model aiassistants {
  63. id String @id @default(auto()) @map("_id") @db.ObjectId
  64. /// Field referred in an index, but found no data to define the type.
  65. grantedGroupsForAccessScope AiassistantsGrantedGroupsForAccessScope?
  66. /// Field referred in an index, but found no data to define the type.
  67. grantedGroupsForShareScope AiassistantsGrantedGroupsForShareScope?
  68. @@index([grantedGroupsForShareScope.item], map: "grantedGroupsForShareScope.item_1")
  69. @@index([grantedGroupsForAccessScope.item], map: "grantedGroupsForAccessScope.item_1")
  70. }
  71. model attachments {
  72. id String @id @default(auto()) @map("_id") @db.ObjectId
  73. /// Field referred in an index, but found no data to define the type.
  74. creator Json?
  75. /// Field referred in an index, but found no data to define the type.
  76. fileName Json? @unique(map: "fileName_1")
  77. /// Field referred in an index, but found no data to define the type.
  78. page Json?
  79. @@index([page], map: "page_1")
  80. @@index([creator], map: "creator_1")
  81. }
  82. model bookmarkfolders {
  83. id String @id @default(auto()) @map("_id") @db.ObjectId
  84. /// Field referred in an index, but found no data to define the type.
  85. owner Json?
  86. @@index([owner], map: "owner_1")
  87. }
  88. model bookmarks {
  89. id String @id @default(auto()) @map("_id") @db.ObjectId
  90. /// Field referred in an index, but found no data to define the type.
  91. page Json?
  92. /// Field referred in an index, but found no data to define the type.
  93. user Json?
  94. @@unique([page, user], map: "page_1_user_1")
  95. @@index([page], map: "page_1")
  96. @@index([user], map: "user_1")
  97. }
  98. model comments {
  99. id String @id @default(auto()) @map("_id") @db.ObjectId
  100. /// Field referred in an index, but found no data to define the type.
  101. creator Json?
  102. /// Field referred in an index, but found no data to define the type.
  103. page Json?
  104. /// Field referred in an index, but found no data to define the type.
  105. revision Json?
  106. @@index([page], map: "page_1")
  107. @@index([creator], map: "creator_1")
  108. @@index([revision], map: "revision_1")
  109. }
  110. model configs {
  111. id String @id @default(auto()) @map("_id") @db.ObjectId
  112. v Int? @map("__v")
  113. createdAt DateTime @db.Date
  114. key String @unique(map: "key_1")
  115. updatedAt DateTime @db.Date
  116. value String
  117. }
  118. model editorsettings {
  119. id String @id @default(auto()) @map("_id") @db.ObjectId
  120. }
  121. model externalaccounts {
  122. id String @id @default(auto()) @map("_id") @db.ObjectId
  123. /// Field referred in an index, but found no data to define the type.
  124. accountId Json?
  125. /// Field referred in an index, but found no data to define the type.
  126. providerType Json?
  127. @@unique([providerType, accountId], map: "providerType_1_accountId_1")
  128. }
  129. model externalusergrouprelations {
  130. id String @id @default(auto()) @map("_id") @db.ObjectId
  131. }
  132. model externalusergroups {
  133. id String @id @default(auto()) @map("_id") @db.ObjectId
  134. /// Field referred in an index, but found no data to define the type.
  135. externalId Json? @unique(map: "externalId_1")
  136. /// Field referred in an index, but found no data to define the type.
  137. name Json?
  138. /// Field referred in an index, but found no data to define the type.
  139. parent Json?
  140. /// Field referred in an index, but found no data to define the type.
  141. provider Json?
  142. @@unique([name, provider], map: "name_1_provider_1")
  143. @@index([parent], map: "parent_1")
  144. }
  145. model failedemails {
  146. id String @id @default(auto()) @map("_id") @db.ObjectId
  147. /// Field referred in an index, but found no data to define the type.
  148. createdAt Json?
  149. @@index([createdAt], map: "createdAt_1")
  150. }
  151. model globalnotificationsettings {
  152. id String @id @default(auto()) @map("_id") @db.ObjectId
  153. }
  154. model growiplugins {
  155. id String @id @default(auto()) @map("_id") @db.ObjectId
  156. }
  157. model inappnotifications {
  158. id String @id @default(auto()) @map("_id") @db.ObjectId
  159. /// Field referred in an index, but found no data to define the type.
  160. action Json?
  161. /// Field referred in an index, but found no data to define the type.
  162. createdAt Json?
  163. /// Field referred in an index, but found no data to define the type.
  164. status Json?
  165. /// Field referred in an index, but found no data to define the type.
  166. target Json?
  167. /// Field referred in an index, but found no data to define the type.
  168. user Json?
  169. @@index([user], map: "user_1")
  170. @@index([status], map: "status_1")
  171. @@index([createdAt], map: "createdAt_1")
  172. @@index([user, target, action, createdAt], map: "user_1_target_1_action_1_createdAt_1")
  173. }
  174. model inappnotificationsettings {
  175. id String @id @default(auto()) @map("_id") @db.ObjectId
  176. }
  177. model migrations {
  178. id String @id @default(auto()) @map("_id") @db.ObjectId
  179. appliedAt DateTime @db.Date
  180. fileName String
  181. }
  182. model namedqueries {
  183. id String @id @default(auto()) @map("_id") @db.ObjectId
  184. v Int @map("__v")
  185. /// Could not determine type: the field only had null or empty values in the sample set.
  186. creator Json?
  187. delegatorName String
  188. name String @unique(map: "name_1")
  189. @@index([creator], map: "creator_1")
  190. }
  191. model pagebulkexportjobs {
  192. id String @id @default(auto()) @map("_id") @db.ObjectId
  193. }
  194. model pagebulkexportpagesnapshots {
  195. id String @id @default(auto()) @map("_id") @db.ObjectId
  196. }
  197. model pageoperations {
  198. id String @id @default(auto()) @map("_id") @db.ObjectId
  199. /// Field referred in an index, but found no data to define the type.
  200. actionStage Json?
  201. /// Field referred in an index, but found no data to define the type.
  202. actionType Json?
  203. /// Field referred in an index, but found no data to define the type.
  204. exPage PageoperationsExPage?
  205. /// Field referred in an index, but found no data to define the type.
  206. fromPath Json?
  207. /// Field referred in an index, but found no data to define the type.
  208. page PageoperationsPage?
  209. /// Field referred in an index, but found no data to define the type.
  210. toPath Json?
  211. @@index([actionType], map: "actionType_1")
  212. @@index([actionStage], map: "actionStage_1")
  213. @@index([fromPath], map: "fromPath_1")
  214. @@index([toPath], map: "toPath_1")
  215. @@index([page.id], map: "page._id_1")
  216. @@index([page.path], map: "page.path_1")
  217. @@index([exPage.id], map: "exPage._id_1")
  218. @@index([exPage.path], map: "exPage.path_1")
  219. }
  220. model pageredirects {
  221. id String @id @default(auto()) @map("_id") @db.ObjectId
  222. /// Field referred in an index, but found no data to define the type.
  223. fromPath Json? @unique(map: "fromPath_1")
  224. }
  225. model pages {
  226. id String @id @default(auto()) @map("_id") @db.ObjectId
  227. v Int @map("__v")
  228. commentCount Int
  229. createdAt DateTime @db.Date
  230. creator String? @db.ObjectId
  231. descendantCount Int
  232. grant Int
  233. /// Nested objects had no data in the sample dataset to introspect a nested type.
  234. grantedGroups Json?
  235. /// Could not determine type: the field only had null or empty values in the sample set.
  236. grantedUsers Json?
  237. isEmpty Boolean
  238. lastUpdateUser String? @db.ObjectId
  239. latestRevisionBodyLength Int?
  240. /// Could not determine type: the field only had null or empty values in the sample set.
  241. liker Json?
  242. parent String? @db.ObjectId
  243. path String
  244. revision String? @db.ObjectId
  245. seenUsers String[]
  246. status String
  247. ttlTimestamp DateTime? @db.Date
  248. updatedAt DateTime @db.Date
  249. wip Boolean?
  250. revisions revisions[]
  251. @@index([parent], map: "parent_1")
  252. @@index([path], map: "path_1")
  253. @@index([status], map: "status_1")
  254. @@index([grant], map: "grant_1")
  255. @@index([creator], map: "creator_1")
  256. @@index([createdAt], map: "createdAt_1")
  257. @@index([updatedAt], map: "updatedAt_1")
  258. @@index([ttlTimestamp], map: "ttlTimestamp_1")
  259. }
  260. model pagetagrelations {
  261. id String @id @default(auto()) @map("_id") @db.ObjectId
  262. /// Field referred in an index, but found no data to define the type.
  263. isPageTrashed Json?
  264. /// Field referred in an index, but found no data to define the type.
  265. relatedPage Json?
  266. /// Field referred in an index, but found no data to define the type.
  267. relatedTag Json?
  268. @@unique([relatedPage, relatedTag], map: "relatedPage_1_relatedTag_1")
  269. @@index([relatedPage], map: "relatedPage_1")
  270. @@index([relatedTag], map: "relatedTag_1")
  271. @@index([isPageTrashed], map: "isPageTrashed_1")
  272. }
  273. model passwordresetorders {
  274. id String @id @default(auto()) @map("_id") @db.ObjectId
  275. /// Field referred in an index, but found no data to define the type.
  276. token Json? @unique(map: "token_1")
  277. }
  278. model revisions {
  279. id String @id @default(auto()) @map("_id") @db.ObjectId
  280. v Int @map("__v")
  281. author String @db.ObjectId
  282. body String
  283. createdAt DateTime @db.Date
  284. format String
  285. origin String?
  286. pageId String @db.ObjectId
  287. page pages @relation(fields: [pageId], references: [id])
  288. @@index([pageId], map: "pageId_1")
  289. }
  290. model rlflx {
  291. id String @id @default(auto()) @map("_id") @db.ObjectId
  292. /// Field referred in an index, but found no data to define the type.
  293. expire Json?
  294. /// Field referred in an index, but found no data to define the type.
  295. key Json? @unique(map: "key_1")
  296. @@index([expire(sort: Desc)], map: "expire_-1")
  297. }
  298. model sessions {
  299. id String @id @map("_id")
  300. expires DateTime @db.Date
  301. session String
  302. @@index([expires], map: "expires_1")
  303. }
  304. model sharelinks {
  305. id String @id @default(auto()) @map("_id") @db.ObjectId
  306. /// Field referred in an index, but found no data to define the type.
  307. relatedPage Json?
  308. @@index([relatedPage], map: "relatedPage_1")
  309. }
  310. model slackappintegrations {
  311. id String @id @default(auto()) @map("_id") @db.ObjectId
  312. /// Field referred in an index, but found no data to define the type.
  313. isPrimary Json? @unique(map: "isPrimary_1")
  314. /// Field referred in an index, but found no data to define the type.
  315. tokenGtoP Json? @unique(map: "tokenGtoP_1")
  316. /// Field referred in an index, but found no data to define the type.
  317. tokenPtoG Json? @unique(map: "tokenPtoG_1")
  318. }
  319. model subscriptions {
  320. id String @id @default(auto()) @map("_id") @db.ObjectId
  321. /// Field referred in an index, but found no data to define the type.
  322. user Json?
  323. @@index([user], map: "user_1")
  324. }
  325. model tags {
  326. id String @id @default(auto()) @map("_id") @db.ObjectId
  327. /// Field referred in an index, but found no data to define the type.
  328. name Json? @unique(map: "name_1")
  329. }
  330. model threadrelations {
  331. id String @id @default(auto()) @map("_id") @db.ObjectId
  332. /// Field referred in an index, but found no data to define the type.
  333. threadId Json? @unique(map: "threadId_1")
  334. }
  335. model transferkeys {
  336. id String @id @default(auto()) @map("_id") @db.ObjectId
  337. /// Field referred in an index, but found no data to define the type.
  338. expireAt Json?
  339. /// Field referred in an index, but found no data to define the type.
  340. key Json? @unique(map: "key_1")
  341. /// Field referred in an index, but found no data to define the type.
  342. keyString Json? @unique(map: "keyString_1")
  343. @@index([expireAt], map: "expireAt_1")
  344. }
  345. model updateposts {
  346. id String @id @default(auto()) @map("_id") @db.ObjectId
  347. /// Field referred in an index, but found no data to define the type.
  348. creator Json?
  349. @@index([creator], map: "creator_1")
  350. }
  351. model usergrouprelations {
  352. id String @id @default(auto()) @map("_id") @db.ObjectId
  353. v Int @map("__v")
  354. createdAt DateTime @db.Date
  355. relatedGroup String @db.ObjectId
  356. relatedUser String @db.ObjectId
  357. }
  358. model usergroups {
  359. id String @id @default(auto()) @map("_id") @db.ObjectId
  360. v Int @map("__v")
  361. createdAt DateTime @db.Date
  362. description String
  363. name String @unique(map: "name_1")
  364. /// Could not determine type: the field only had null or empty values in the sample set.
  365. parent Json?
  366. updatedAt DateTime @db.Date
  367. @@index([parent], map: "parent_1")
  368. }
  369. model userregistrationorders {
  370. id String @id @default(auto()) @map("_id") @db.ObjectId
  371. /// Field referred in an index, but found no data to define the type.
  372. token Json? @unique(map: "token_1")
  373. }
  374. model users {
  375. id String @id @default(auto()) @map("_id") @db.ObjectId
  376. v Int @map("__v")
  377. admin Boolean
  378. /// Field referred in an index, but found no data to define the type.
  379. apiToken Json?
  380. createdAt DateTime @db.Date
  381. email String @unique(map: "email_1")
  382. imageUrlCached String
  383. isEmailPublished Boolean
  384. isGravatarEnabled Boolean
  385. isInvitationEmailSended Boolean
  386. lang String
  387. /// Field referred in an index, but found no data to define the type.
  388. lastLoginAt Json?
  389. name String
  390. password String
  391. readOnly Boolean
  392. /// Field referred in an index, but found no data to define the type.
  393. slackMemberId Json? @unique(map: "slackMemberId_1")
  394. status Int
  395. updatedAt DateTime @db.Date
  396. username String @unique(map: "username_1")
  397. @@index([name], map: "name_1")
  398. @@index([apiToken], map: "apiToken_1")
  399. @@index([status], map: "status_1")
  400. @@index([lastLoginAt], map: "lastLoginAt_1")
  401. @@index([admin], map: "admin_1")
  402. }
  403. model useruisettings {
  404. id String @id @default(auto()) @map("_id") @db.ObjectId
  405. /// Field referred in an index, but found no data to define the type.
  406. user Json? @unique(map: "user_1")
  407. }
  408. model vectorstorefilerelations {
  409. id String @id @default(auto()) @map("_id") @db.ObjectId
  410. /// Field referred in an index, but found no data to define the type.
  411. attachment Json?
  412. /// Field referred in an index, but found no data to define the type.
  413. page Json?
  414. /// Field referred in an index, but found no data to define the type.
  415. vectorStoreRelationId Json?
  416. @@unique([vectorStoreRelationId, page, attachment], map: "vectorStoreRelationId_1_page_1_attachment_1")
  417. }
  418. model vectorstores {
  419. id String @id @default(auto()) @map("_id") @db.ObjectId
  420. /// Field referred in an index, but found no data to define the type.
  421. vectorStoreId Json? @unique(map: "vectorStoreId_1")
  422. }
  423. model yjs_writings {
  424. id String @id @default(auto()) @map("_id") @db.ObjectId
  425. action String?
  426. clock Int?
  427. docName String
  428. metaKey String?
  429. /// Field referred in an index, but found no data to define the type.
  430. part Json?
  431. /// Multiple data types found: Float: 33.3%, Binary: 66.7% out of 3 sampled entries
  432. value Json
  433. version String
  434. @@index([version, docName, action, clock, part], map: "version_1_docName_1_action_1_clock_1_part_1")
  435. @@index([version, docName, metaKey], map: "version_1_docName_1_metaKey_1")
  436. @@index([docName, clock], map: "docName_1_clock_1")
  437. @@map("yjs-writings")
  438. }