public.workflow_suggestion¶
列¶
| 名称 | 类型 | 默认值 | 可空 | 子表 | 父表 | 注释 |
|---|---|---|---|---|---|---|
| appliedAction | varchar(32) | 是 | 保存已审核修复的操作 | |||
| appliedActorId | uuid | 是 | 用户删除后保留的人工操作者 ID | |||
| appliedChecksum | varchar(64) | 是 | 已保存工作流的 SHA-256 校验和 | |||
| appliedVersionId | varchar(36) | 是 | 历史记录删除后保留的已保存版本 ID | |||
| backgroundUserId | uuid | 否 | public.user | 启用调查的用户 | ||
| closedAt | timestamp(3) with time zone | 是 | ||||
| closedReason | varchar(16) | 是 | 建议关闭的原因 | |||
| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | 否 | |||
| expectedBaseline | json | 否 | 从原始工作流捕获的 savedVersionId、publishedVersionId 和校验和 | |||
| id | varchar(36) | 否 | public.workflow_suggestion_activity | |||
| payload | json | 否 | 原始工作流快照、候选节点与连接、解释和错误上下文 | |||
| projectId | varchar(36) | 否 | public.project | 原始所属项目 | ||
| resultKind | varchar(16) | 否 | 调查结果;仅 fix_ready 允许 Apply | |||
| selfHealingResultId | varchar(36) | 否 | public.self_healing_result | 包含此建议的自愈结果 | ||
| state | varchar(16) | 否 | 建议生命周期状态 | |||
| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | 否 | |||
| workflowId | varchar(36) | 否 | public.workflow_entity | 目标工作流 |
约束¶
| 名称 | 类型 | 定义 |
|---|---|---|
| CHK_workflow_suggestion_appliedAction | CHECK | CHECK ((("appliedAction")::text = ANY ((ARRAY['apply'::character varying, 'approve-and-publish'::character varying])::text[]))) |
| CHK_workflow_suggestion_closedReason | CHECK | CHECK ((("closedReason")::text = ANY ((ARRAY['outdated'::character varying, 'applied'::character varying, 'discarded'::character varying])::text[]))) |
| CHK_workflow_suggestion_resultKind | CHECK | CHECK ((("resultKind")::text = ANY ((ARRAY['fix_ready'::character varying, 'needs_you'::character varying])::text[]))) |
| CHK_workflow_suggestion_state | CHECK | CHECK (((state)::text = ANY ((ARRAY['pending'::character varying, 'closed'::character varying])::text[]))) |
| FK_0f273c2cd9e1a097a8ba044fe9a | FOREIGN KEY | FOREIGN KEY ("projectId") REFERENCES project(id) ON DELETE CASCADE |
| FK_b415d749769e092f51575def2d2 | FOREIGN KEY | FOREIGN KEY ("backgroundUserId") REFERENCES "user"(id) ON DELETE CASCADE |
| FK_f6289858234727cdff168626dc9 | FOREIGN KEY | FOREIGN KEY ("workflowId") REFERENCES workflow_entity(id) ON DELETE CASCADE |
| FK_workflow_suggestion_self_healing_result | FOREIGN KEY | FOREIGN KEY ("selfHealingResultId") REFERENCES self_healing_result(id) ON DELETE CASCADE |
| PK_529f3c424f40b3174e5e77e1cf3 | PRIMARY KEY | PRIMARY KEY (id) |
| workflow_suggestion_backgroundUserId_not_null | n | NOT NULL "backgroundUserId" |
| workflow_suggestion_createdAt_not_null | n | NOT NULL "createdAt" |
| workflow_suggestion_expectedBaseline_not_null | n | NOT NULL "expectedBaseline" |
| workflow_suggestion_id_not_null | n | NOT NULL id |
| workflow_suggestion_payload_not_null | n | NOT NULL payload |
| workflow_suggestion_projectId_not_null | n | NOT NULL "projectId" |
| workflow_suggestion_resultKind_not_null | n | NOT NULL "resultKind" |
| workflow_suggestion_selfHealingResultId_not_null | n | NOT NULL "selfHealingResultId" |
| workflow_suggestion_state_not_null | n | NOT NULL state |
| workflow_suggestion_updatedAt_not_null | n | NOT NULL "updatedAt" |
| workflow_suggestion_workflowId_not_null | n | NOT NULL "workflowId" |
索引¶
| 名称 | 定义 |
|---|---|
| IDX_0f273c2cd9e1a097a8ba044fe9 | CREATE INDEX "IDX_0f273c2cd9e1a097a8ba044fe9" ON public.workflow_suggestion USING btree ("projectId") |
| IDX_b415d749769e092f51575def2d | CREATE INDEX "IDX_b415d749769e092f51575def2d" ON public.workflow_suggestion USING btree ("backgroundUserId") |
| IDX_f6289858234727cdff168626dc | CREATE INDEX "IDX_f6289858234727cdff168626dc" ON public.workflow_suggestion USING btree ("workflowId") |
| IDX_workflow_suggestion_selfHealingResultId | CREATE INDEX "IDX_workflow_suggestion_selfHealingResultId" ON public.workflow_suggestion USING btree ("selfHealingResultId") |
| IDX_workflow_suggestion_workflowId | CREATE UNIQUE INDEX "IDX_workflow_suggestion_workflowId" ON public.workflow_suggestion USING btree ("workflowId") WHERE ((state)::text = 'pending'::text) |
| PK_529f3c424f40b3174e5e77e1cf3 | CREATE UNIQUE INDEX "PK_529f3c424f40b3174e5e77e1cf3" ON public.workflow_suggestion USING btree (id) |
关系¶
erDiagram
"public.workflow_suggestion" }o--|| "public.user" : "FOREIGN KEY (#quot;backgroundUserId#quot;) REFERENCES #quot;user#quot;(id) ON DELETE CASCADE"
"public.workflow_suggestion_activity" }o--|| "public.workflow_suggestion" : "FOREIGN KEY (#quot;suggestionId#quot;) REFERENCES workflow_suggestion(id) ON DELETE CASCADE"
"public.workflow_suggestion" }o--|| "public.project" : "FOREIGN KEY (#quot;projectId#quot;) REFERENCES project(id) ON DELETE CASCADE"
"public.workflow_suggestion" }o--|| "public.self_healing_result" : "FOREIGN KEY (#quot;selfHealingResultId#quot;) REFERENCES self_healing_result(id) ON DELETE CASCADE"
"public.workflow_suggestion" }o--|| "public.workflow_entity" : "FOREIGN KEY (#quot;workflowId#quot;) REFERENCES workflow_entity(id) ON DELETE CASCADE"
"public.workflow_suggestion" {
varchar_32_ appliedAction
uuid appliedActorId
varchar_64_ appliedChecksum
varchar_36_ appliedVersionId
uuid backgroundUserId FK
timestamp_3__with_time_zone closedAt
varchar_16_ closedReason
timestamp_3__with_time_zone createdAt
json expectedBaseline
varchar_36_ id
json payload
varchar_36_ projectId FK
varchar_16_ resultKind
varchar_36_ selfHealingResultId FK
varchar_16_ state
timestamp_3__with_time_zone updatedAt
varchar_36_ workflowId FK
}
"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.workflow_suggestion_activity" {
varchar_16_ action
uuid actorId FK
varchar_16_ author
timestamp_3__with_time_zone createdAt
varchar_36_ id
varchar_36_ suggestionId FK
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
}
"public.self_healing_result" {
uuid backgroundUserId FK
timestamp_3__with_time_zone completedAt
integer configurationId FK
timestamp_3__with_time_zone createdAt
varchar_36_ executionId
varchar_36_ id
varchar_16_ outcome
varchar_36_ projectId FK
text report
varchar_16_ reviewState
text summary
timestamp_3__with_time_zone updatedAt
json usage
varchar_36_ workflowId FK
}
"public.workflow_entity" {
boolean active
varchar_36_ activeVersionId FK
json connections
timestamp_3__with_time_zone createdAt
text description
varchar_36_ id
boolean isArchived
json meta
varchar_128_ name
json nodeGroups
json nodes
varchar_36_ parentFolderId FK
json pinData
json settings
varchar sourceWorkflowId
json staticData
integer triggerCount
timestamp_3__with_time_zone updatedAt
integer versionCounter
character_36_ versionId
}由 tbls 生成
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 n8/n8n