跳转至

public.skill_source

列

名称 类型 默认值 可空 子表 父表 注释
createdAt timestamp(3) with time zone CURRENT_TIMESTAMP(3) false
createdById uuid true public.user 创建者。检查任务会读取该用户的功能开关。用户被删除后为 NULL。
credentialId varchar(36) true public.credentials_entity 用于读取私有源的凭证。NULL = 公开访问。
credentialRequired boolean false false 当源需要凭证时为 true,即使该凭证被删除后也是如此。
id uuid false public.skill_source_link 由应用程序生成的 UUIDv7。
identityKey varchar(255) false 源类型、主机、所有者和仓库,均为小写,例如 "github:github.com/acme/skills"。去重规则会比较该值。
lastCheckedAt timestamp(3) with time zone true 最后一次检查的结束时间。首次检查前为 NULL。
lastErrorReason varchar(32) true 上一次失败检查的原因代码,例如 "rate_limited"。成功后为 NULL。
locator json false 技能所在位置,由客户端从链接中解析得到。对核心不透明。
probeCursor text true 上次变更探测的不透明值,例如 commit SHA。首次检查前为 NULL。
projectId varchar(36) true public.project 作用范围:团队或个人项目。NULL = 全局(Global)。
status varchar(32) 'connected'::character varying false 源的健康状态,由最后一次检查设置。
type varchar(16) false 源类型,例如 "github"。用于选择客户端。
unlinkedSkills json true 未链接的技能键、内容哈希、判定结果和跳过标记。不包含内容。
updatedAt timestamp(3) with time zone CURRENT_TIMESTAMP(3) false

约束

名称 类型 定义
CHK_skill_source_status CHECK CHECK (((status)::text = ANY ((ARRAY['connected'::character varying, 'credential_expired'::character varying, 'unreachable'::character varying, 'delayed'::character varying])::text[])))
FK_172d2de74bff36e50fef736a5e8 FOREIGN KEY FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE
FK_1c91a0839e34c1b48610160761e FOREIGN KEY FOREIGN KEY ("createdById") REFERENCES "user"(id) ON DELETE SET NULL
FK_b3474e16029bf15a015e3f3a8d6 FOREIGN KEY FOREIGN KEY ("credentialId") REFERENCES credentials_entity(id) ON DELETE SET NULL
PK_c121774d21c9f67119b1d0d865a PRIMARY KEY PRIMARY KEY (id)
skill_source_createdAt_not_null n NOT NULL "createdAt"
skill_source_credentialRequired_not_null n NOT NULL "credentialRequired"
skill_source_id_not_null n NOT NULL id
skill_source_identityKey_not_null n NOT NULL "identityKey"
skill_source_locator_not_null n NOT NULL locator
skill_source_status_not_null n NOT NULL status
skill_source_type_not_null n NOT NULL type
skill_source_updatedAt_not_null n NOT NULL "updatedAt"

索引

名称 定义
IDX_172d2de74bff36e50fef736a5e CREATE INDEX "IDX_172d2de74bff36e50fef736a5e" ON public.skill_source USING btree ("projectId")
IDX_skill_source_identityKey CREATE UNIQUE INDEX "IDX_skill_source_identityKey" ON public.skill_source USING btree ("identityKey") WHERE ("projectId" IS NULL)
IDX_skill_source_identityKey_projectId CREATE UNIQUE INDEX "IDX_skill_source_identityKey_projectId" ON public.skill_source USING btree ("identityKey", "projectId") WHERE ("projectId" IS NOT NULL)
PK_c121774d21c9f67119b1d0d865a CREATE UNIQUE INDEX "PK_c121774d21c9f67119b1d0d865a" ON public.skill_source USING btree (id)

关系

erDiagram

"public.skill_source" }o--o| "public.user" : "FOREIGN KEY (#quot;createdById#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL"
"public.skill_source" }o--o| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE SET NULL"
"public.skill_source_link" }o--|| "public.skill_source" : "FOREIGN KEY (#quot;sourceId#quot;) REFERENCES skill_source(id) ON DELETE CASCADE"
"public.skill_source" }o--o| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE"

"public.skill_source" {
  timestamp_3__with_time_zone createdAt
  uuid createdById FK
  varchar_36_ credentialId FK
  boolean credentialRequired
  uuid id
  varchar_255_ identityKey
  timestamp_3__with_time_zone lastCheckedAt
  varchar_32_ lastErrorReason
  json locator
  text probeCursor
  varchar_36_ projectId FK
  varchar_32_ status
  varchar_16_ type
  json unlinkedSkills
  timestamp_3__with_time_zone updatedAt
}
"public.user" {
  timestamp_3__with_time_zone createdAt
  boolean disabled
  varchar_255_ email
  varchar_32_ firstName
  uuid id
  varchar_16_ kind
  date lastActiveAt
  varchar_32_ lastName
  boolean mfaEnabled
  text mfaRecoveryCodes
  text mfaSecret
  varchar_255_ password
  json personalizationAnswers
  varchar_128_ roleSlug FK
  json settings
  timestamp_3__with_time_zone updatedAt
}
"public.credentials_entity" {
  timestamp_3__with_time_zone createdAt
  text data
  text description
  varchar_36_ id
  boolean isGlobal
  boolean isManaged
  boolean isResolvable
  varchar_128_ name
  timestamp_3__with_time_zone pendingAuthorizationExpiresAt
  boolean resolvableAllowFallback
  varchar_16_ resolverId FK
  varchar_128_ type
  timestamp_3__with_time_zone updatedAt
  varchar_16_ usageScope
}
"public.skill_source_link" {
  varchar_64_ baseContentHash
  varchar_255_ baseRevision
  timestamp_3__with_time_zone createdAt
  json pendingContent
  varchar_64_ pendingContentHash
  varchar_255_ pendingRevision
  json pendingScan
  json remoteRef
  varchar_36_ skillId FK
  varchar_64_ skippedContentHash
  json skippedFiles
  uuid sourceId FK
  varchar_32_ state
  timestamp_3__with_time_zone updatedAt
}
"public.project" {
  timestamp_3__with_time_zone createdAt
  uuid creatorId FK
  json customTelemetryTags
  varchar_512_ description
  json icon
  varchar_36_ id
  varchar_255_ name
  varchar_36_ type
  timestamp_3__with_time_zone updatedAt
}

由 tbls 生成

本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 n8/n8n