Bieber 4f4c0f2824
[sync] Fix Sentry Release (T1750) (#1094) (#2471)
Synced from teableio/teable-ee@d43bb45

Co-authored-by: teable-bot <bot@teable.io>
2026-01-22 18:13:14 +08:00

739 lines
24 KiB
Plaintext

generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-3.0.x"]
}
datasource db {
provider = "postgres"
url = env("PRISMA_DATABASE_URL")
}
model Space {
id String @id @default(cuid())
name String
credit Int?
deletedTime DateTime? @map("deleted_time")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastModifiedBy String? @map("last_modified_by")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
isTemplate Boolean? @map("is_template")
baseGroup Base[]
@@map("space")
}
model PinResource {
id String @id @default(cuid())
type String @map("type")
resourceId String @map("resource_id")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
order Float @map("order")
@@unique([createdBy, resourceId])
@@index([order])
@@map("pin_resource")
}
model Base {
id String @id @default(cuid())
spaceId String @map("space_id")
name String
order Float
icon String?
schemaPass String? @map("schema_pass")
deletedTime DateTime? @map("deleted_time")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastModifiedBy String? @map("last_modified_by")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
space Space @relation(fields: [spaceId], references: [id])
tables TableMeta[]
@@index([order])
@@map("base")
}
model TableMeta {
id String @id
baseId String @map("base_id")
name String
description String?
icon String?
dbTableName String @map("db_table_name")
dbViewName String? @map("db_view_name")
version Int
order Float
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
deletedTime DateTime? @map("deleted_time")
createdBy String @map("created_by")
lastModifiedBy String? @map("last_modified_by")
base Base @relation(fields: [baseId], references: [id])
fields Field[]
views View[]
pluginPanel PluginPanel[]
pluginContextMenu PluginContextMenu[]
@@index([order])
@@index([dbTableName])
@@index([baseId, deletedTime])
@@map("table_meta")
}
model Field {
id String @id
name String
description String?
options String?
meta String?
aiConfig String? @map("ai_config")
type String
cellValueType String @map("cell_value_type")
isMultipleCellValue Boolean? @map("is_multiple_cell_value")
dbFieldType String @map("db_field_type")
dbFieldName String @map("db_field_name")
notNull Boolean? @map("not_null")
unique Boolean?
isPrimary Boolean? @map("is_primary")
isComputed Boolean? @map("is_computed")
isLookup Boolean? @map("is_lookup")
isConditionalLookup Boolean? @map("is_conditional_lookup")
isPending Boolean? @map("is_pending")
hasError Boolean? @map("has_error")
// the link field id that a lookup field is linked to
lookupLinkedFieldId String? @map("lookup_linked_field_id")
lookupOptions String? @map("lookup_options")
tableId String @map("table_id")
order Float
version Int
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
deletedTime DateTime? @map("deleted_time")
createdBy String @map("created_by")
lastModifiedBy String? @map("last_modified_by")
table TableMeta @relation(fields: [tableId], references: [id])
@@index([lookupLinkedFieldId])
@@index([tableId, deletedTime])
@@map("field")
}
model View {
id String @id
name String
description String?
tableId String @map("table_id")
type String
sort String?
filter String?
group String?
options String?
order Float
version Int
columnMeta String @map("column_meta")
isLocked Boolean? @map("is_locked")
enableShare Boolean? @map("enable_share")
shareId String? @unique @map("share_id")
shareMeta String? @map("share_meta")
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
deletedTime DateTime? @map("deleted_time")
createdBy String @map("created_by")
lastModifiedBy String? @map("last_modified_by")
table TableMeta @relation(fields: [tableId], references: [id])
@@index([order])
@@index([tableId, deletedTime])
@@map("view")
}
model Ops {
id String @id @default(cuid())
collection String
docId String @map("doc_id")
docType String @map("doc_type")
version Int
operation String
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
@@unique([collection, docId, version])
@@index([collection, createdTime])
@@map("ops")
}
model Reference {
id String @id @default(cuid())
fromFieldId String @map("from_field_id")
toFieldId String @map("to_field_id")
createdTime DateTime @default(now()) @map("created_time")
@@unique([toFieldId, fromFieldId])
@@index([fromFieldId])
@@index([toFieldId])
@@map("reference")
}
model User {
id String @id @default(cuid())
name String
password String?
salt String?
phone String? @unique
email String @unique
avatar String?
isSystem Boolean? @map("is_system")
isAdmin Boolean? @map("is_admin")
isTrialUsed Boolean? @map("is_trial_used")
lang String? @map("lang")
notifyMeta String? @map("notify_meta")
lastSignTime DateTime? @map("last_sign_time")
deactivatedTime DateTime? @map("deactivated_time")
createdTime DateTime @default(now()) @map("created_time")
deletedTime DateTime? @map("deleted_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
permanentDeletedTime DateTime? @map("permanent_deleted_time")
refMeta String? @map("ref_meta")
accounts Account[]
@@map("users")
}
model Account {
id String @id @default(cuid())
userId String @map("user_id")
type String
provider String
providerId String @map("provider_id")
createdTime DateTime @default(now()) @map("created_time")
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerId])
@@map("account")
}
model Attachments {
id String @id @default(cuid())
token String @unique
hash String
size Int
mimetype String
path String
width Int?
height Int?
deletedTime DateTime? @map("deleted_time")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastModifiedBy String? @map("last_modified_by")
thumbnailPath String? @map("thumbnail_path")
@@map("attachments")
}
model AttachmentsTable {
id String @id @default(cuid())
attachmentId String @map("attachment_id")
name String
token String
tableId String @map("table_id")
recordId String @map("record_id")
fieldId String @map("field_id")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastModifiedBy String? @map("last_modified_by")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
@@index([tableId, recordId])
@@index([tableId, fieldId])
@@index([attachmentId])
@@map("attachments_table")
}
model Collaborator {
id String @id @default(cuid())
roleName String @map("role_name")
resourceType String @map("resource_type")
resourceId String @map("resource_id")
principalId String @map("principal_id")
principalType String @map("principal_type")
createdBy String @map("created_by")
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
lastModifiedBy String? @map("last_modified_by")
@@unique([resourceType, resourceId, principalId, principalType])
@@index([resourceId])
@@index([principalId])
@@map("collaborator")
}
model Invitation {
id String @id @default(cuid())
baseId String? @map("base_id")
spaceId String? @map("space_id")
type String @map("type")
role String
invitationCode String @map("invitation_code")
expiredTime DateTime? @map("expired_time")
createdBy String @map("create_by")
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
lastModifiedBy String? @map("last_modified_by")
deletedTime DateTime? @map("deleted_time")
@@index([baseId])
@@index([spaceId])
@@map("invitation")
}
model InvitationRecord {
id String @id @default(cuid())
invitationId String @map("invitation_id")
baseId String? @map("base_id")
spaceId String? @map("space_id")
type String @map("type")
inviter String @map("inviter")
accepter String @map("accepter")
createdTime DateTime @default(now()) @map("created_time")
@@index([invitationId])
@@index([baseId])
@@index([spaceId])
@@map("invitation_record")
}
model Notification {
id String @id @default(cuid())
fromUserId String @map("from_user_id")
toUserId String @map("to_user_id")
type String @map("type")
message String @map("message")
messageI18n String? @map("message_i18n")
urlPath String? @map("url_path")
isRead Boolean @default(false) @map("is_read")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
@@index([toUserId, isRead, createdTime])
@@map("notification")
}
model AccessToken {
id String @id @default(cuid())
name String
description String?
userId String @map("user_id")
scopes String
spaceIds String? @map("space_ids")
baseIds String? @map("base_ids")
sign String
clientId String? @map("client_id")
hasFullAccess Boolean? @map("has_full_access")
expiredTime DateTime @map("expired_time")
lastUsedTime DateTime? @map("last_used_time")
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
@@index([userId])
@@index([clientId])
@@map("access_token")
}
model Setting {
name String @unique
content String?
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
createdBy String @map("created_by")
lastModifiedBy String? @map("last_modified_by")
@@map("setting")
}
model OAuthApp {
id String @id @default(cuid())
name String
logo String?
homepage String
description String?
clientId String @unique @map("client_id")
redirectUris String? @map("redirect_uris")
scopes String?
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
createdBy String @map("created_by")
secrets OAuthAppSecret[]
authorized OAuthAppAuthorized[]
@@map("oauth_app")
}
model OAuthAppAuthorized {
id String @id @default(cuid())
clientId String @map("client_id")
userId String @map("user_id")
authorizedTime DateTime @map("authorized_time")
oAuthApp OAuthApp @relation(fields: [clientId], references: [clientId], onDelete: Cascade)
@@unique([clientId, userId])
@@map("oauth_app_authorized")
}
model OAuthAppSecret {
id String @id @default(cuid())
clientId String @map("client_id")
secret String @unique
maskedSecret String @map("masked_secret")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastUsedTime DateTime? @map("last_used_time")
tokens OAuthAppToken[]
oAuthApp OAuthApp @relation(fields: [clientId], references: [clientId], onDelete: Cascade)
@@map("oauth_app_secret")
}
model OAuthAppToken {
id String @id @default(cuid())
appSecretId String @map("app_secret_id")
refreshTokenSign String @unique @map("refresh_token_sign")
expiredTime DateTime @map("expired_time")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
oAuthAppSecret OAuthAppSecret @relation(fields: [appSecretId], references: [id], onDelete: Cascade)
@@map("oauth_app_token")
}
model RecordHistory {
id String @id @default(cuid())
tableId String @map("table_id")
recordId String @map("record_id")
fieldId String @map("field_id")
before String @map("before")
after String @map("after")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
@@index([tableId, recordId, createdTime])
@@index([tableId, createdTime])
@@map("record_history")
}
model Trash {
id String @id @default(cuid())
resourceType String @map("resource_type")
resourceId String @map("resource_id")
parentId String? @map("parent_id")
deletedTime DateTime @default(now()) @map("deleted_time")
deletedBy String @map("deleted_by")
@@unique([resourceType, resourceId])
@@map("trash")
}
model TableTrash {
id String @id @default(cuid())
tableId String @map("table_id")
resourceType String @map("resource_type")
snapshot String @map("snapshot")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
@@index([tableId])
@@map("table_trash")
}
model RecordTrash {
id String @id @default(cuid())
tableId String @map("table_id")
recordId String @map("record_id")
snapshot String @map("snapshot")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
@@index([tableId, recordId])
@@map("record_trash")
}
model Plugin {
id String @id @default(cuid())
name String
description String?
detailDesc String? @map("detail_desc")
logo String
helpUrl String? @map("help_url")
status String
positions String
url String?
secret String @unique
maskedSecret String @map("masked_secret")
i18n String?
config String?
pluginUser String? @map("plugin_user")
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
createdBy String @map("created_by")
lastModifiedBy String? @map("last_modified_by")
pluginInstall PluginInstall[]
@@map("plugin")
}
model PluginInstall {
id String @id @default(cuid())
pluginId String @map("plugin_id")
baseId String @map("base_id")
name String
positionId String @map("position_id")
position String
storage String?
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
lastModifiedBy String? @map("last_modified_by")
plugin Plugin @relation(fields: [pluginId], references: [id], onDelete: Cascade)
@@index([positionId])
@@index([baseId])
@@map("plugin_install")
}
model Dashboard {
id String @id @default(cuid())
name String
baseId String @map("base_id")
layout String?
createdBy String @map("created_by")
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
lastModifiedBy String? @map("last_modified_by")
@@index([baseId])
@@map("dashboard")
}
model Comment {
id String @id @default(cuid())
tableId String @map("table_id")
recordId String @map("record_id")
quoteId String? @map("quote_Id")
content String?
reaction String?
deletedTime DateTime? @map("deleted_time")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
@@index([tableId, recordId])
@@map("comment")
}
model CommentSubscription {
id String @id @default(cuid())
tableId String @map("table_id")
recordId String @map("record_id")
createdBy String @map("created_by")
createdTime DateTime @default(now()) @map("created_time")
@@unique([tableId, recordId])
@@index([tableId, recordId])
@@map("comment_subscription")
}
model Integration {
id String @id @default(cuid())
resourceId String @unique @map("resource_id")
config String @map("config")
type String @map("type")
enable Boolean? @map("enable")
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
@@index([resourceId])
@@map("integration")
}
model PluginPanel {
id String @id @default(cuid())
name String
tableId String @map("table_id")
layout String?
createdBy String @map("created_by")
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
lastModifiedBy String? @map("last_modified_by")
table TableMeta @relation(fields: [tableId], references: [id], onDelete: Cascade)
@@map("plugin_panel")
}
model PluginContextMenu {
id String @id @default(cuid())
tableId String @map("table_id")
pluginInstallId String @unique @map("plugin_install_id")
order Float @map("order")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
lastModifiedBy String? @map("last_modified_by")
table TableMeta @relation(fields: [tableId], references: [id], onDelete: Cascade)
@@map("plugin_context_menu")
}
model UserLastVisit {
id String @id @default(cuid())
userId String @map("user_id")
resourceType String @map("resource_type")
resourceId String @map("resource_id")
parentResourceId String @map("parent_resource_id")
lastVisitTime DateTime @default(now()) @map("last_visit_time")
@@unique([userId, resourceType, resourceId])
@@index([userId, resourceType, parentResourceId])
@@map("user_last_visit")
}
model Template {
id String @id @default(cuid())
baseId String? @map("base_id")
cover String?
name String?
description String?
markdownDescription String? @map("markdown_description")
categoryId String[] @map("category_id")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
lastModifiedBy String? @map("last_modified_by")
isSystem Boolean? @map("is_system")
isPublished Boolean? @map("is_published")
featured Boolean? @map("featured")
snapshot String? @map("snapshot")
order Float @map("order")
usageCount Int @default(0) @map("usage_count")
publishInfo Json? @map("publish_info")
visitCount Int @default(0) @map("visit_count")
@@unique([baseId])
@@map("template")
}
model TemplateCategory {
id String @id @default(cuid())
name String @unique
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
lastModifiedBy String? @map("last_modified_by")
order Float @map("order")
@@map("template_category")
}
model Task {
id String @id @default(cuid())
type String @map("type")
status String @map("status")
snapshot String? @map("snapshot")
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
createdBy String @map("created_by")
lastModifiedBy String? @map("last_modified_by")
runs TaskRun[]
@@index([type, status])
@@map("task")
}
model TaskRun {
id String @id @default(cuid())
taskId String @map("task_id")
status String @map("status")
snapshot String @map("snapshot")
spent Int? @map("spent")
log String? @map("log")
errorMsg String? @map("error_msg")
startedTime DateTime? @map("started_time")
createdTime DateTime @default(now()) @map("created_time")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
task Task @relation(fields: [taskId], references: [id], onDelete: Cascade)
@@index([taskId, status])
@@map("task_run")
}
model TaskReference {
id String @id @default(cuid())
fromFieldId String @map("from_field_id")
toFieldId String @map("to_field_id")
createdTime DateTime @default(now()) @map("created_time")
@@unique([toFieldId, fromFieldId])
@@index([fromFieldId])
@@index([toFieldId])
@@map("task_reference")
}
model Waitlist {
email String @unique @map("email")
invite Boolean? @map("invite")
inviteTime DateTime? @map("invite_time")
createdTime DateTime @default(now()) @map("created_time")
@@map("waitlist")
}
model BaseNode {
id String @id @default(cuid())
parentId String? @map("parent_id")
baseId String @map("base_id")
resourceType String @map("resource_type")
resourceId String @map("resource_id")
order Float @map("order")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
lastModifiedBy String? @map("last_modified_by")
parent BaseNode? @relation("NodeToChildren", fields: [parentId], references: [id])
children BaseNode[] @relation("NodeToChildren")
@@unique([baseId, resourceType, resourceId])
@@map("base_node")
}
model BaseNodeFolder {
id String @id @default(cuid())
baseId String @map("base_id")
name String @map("name")
createdTime DateTime @default(now()) @map("created_time")
createdBy String @map("created_by")
lastModifiedTime DateTime? @updatedAt @map("last_modified_time")
lastModifiedBy String? @map("last_modified_by")
@@unique([baseId, name])
@@map("base_node_folder")
}