跳转至

public.角色

public.role

列

名称 类型 默认 可空 子表 父表 注释
createdAt timestamp(3) with time zone CURRENT_TIMESTAMP(3) false
description text true 更详细描述用户范围的文本
displayName text true 用于在 UI 中显示的名称
roleType text true 角色类型,例如:global、project 或 workflow
slug varchar(128) false public.project_relation public.role_mapping_rule public.role_scope public.user 角色的唯一标识,例如:"global:owner"
systemRole boolean false false 指示该角色是否由系统管理且不可编辑
updatedAt timestamp(3) with time zone CURRENT_TIMESTAMP(3) false

约束

名称 类型 定义
PK_35c9b140caaf6da09cfabb0d675 PRIMARY KEY PRIMARY KEY (slug)
role_createdAt_not_null n NOT NULL "createdAt"
role_slug_not_null n NOT NULL slug
role_systemRole_not_null n NOT NULL "systemRole"
role_updatedAt_not_null n NOT NULL "updatedAt"

索引

名称 定义
IDX_UniqueRoleDisplayName CREATE UNIQUE INDEX "IDX_UniqueRoleDisplayName" ON public.role USING btree ("displayName")
PK_35c9b140caaf6da09cfabb0d675 CREATE UNIQUE INDEX "PK_35c9b140caaf6da09cfabb0d675" ON public.role USING btree (slug)

关系

erDiagram

"public.project_relation" }o--|| "public.role" : "FOREIGN KEY (role) REFERENCES role(slug)"
"public.role_mapping_rule" }o--|| "public.role" : "FOREIGN KEY (role) REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE"
"public.role_scope" }o--|| "public.role" : "FOREIGN KEY (#quot;roleSlug#quot;) REFERENCES role(slug) ON UPDATE CASCADE ON DELETE CASCADE"
"public.user" }o--|| "public.role" : "FOREIGN KEY (#quot;roleSlug#quot;) REFERENCES role(slug)"

"public.role" {
  timestamp_3__with_time_zone createdAt
  text description
  text displayName
  text roleType
  varchar_128_ slug
  boolean systemRole
  timestamp_3__with_time_zone updatedAt
}
"public.project_relation" {
  timestamp_3__with_time_zone createdAt
  varchar_36_ projectId FK
  varchar role FK
  timestamp_3__with_time_zone updatedAt
  uuid userId FK
}
"public.role_mapping_rule" {
  timestamp_3__with_time_zone createdAt
  text expression
  varchar_16_ id
  integer order
  varchar_128_ role FK
  varchar_64_ type
  timestamp_3__with_time_zone updatedAt
}
"public.role_scope" {
  varchar_128_ roleSlug FK
  varchar_128_ scopeSlug 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
}

由 tbls 生成

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