Database Schema
Auto-generated by tools/dbdoc from a live database. Do not edit by hand; regenerate after schema changes.
Contents
- Identity & RBAC(11):
departmentsmenu_permissionsmenuspermissionsrole_data_scope_departmentsrole_permissionsrolessys_postssys_user_postsuser_rolesusers - Auth & Security(5):
console_routesconsole_sessionsoauth_bindingspassword_historytotp_recovery_codes - Multi-tenancy(2):
tenant_packagestenants - System Ops(10):
dict_itemsdict_typeserror_codesnoticesscheduled_job_logsscheduled_jobssms_channelssms_logssms_templatessystem_settings - Audit Logs(3):
audit_logslogin_logsoperation_logs - File Service(1):
files - Workflow (BPM)(5):
bpm_cc_recordbpm_process_definitionbpm_process_instancebpm_process_logbpm_task - Migration Meta(2):
goose_db_versionschema_migrations
Identity & RBAC
departments
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| name | character varying(100) | no | ||
| code | character varying(50) | yes | NULL::character varying | |
| parent_id | bigint | no | 0 | |
| leader | character varying(50) | yes | ''::character varying | |
| phone | character varying(20) | yes | ''::character varying | |
| character varying(100) | yes | ''::character varying | ||
| sort | bigint | no | 0 | |
| status | smallint | no | 1 | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| tenant_id | bigint | no | 1 | |
| leader_user_id | bigint | no | 0 |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (parent_id)btree (tenant_id, code) [UNIQUE]btree (tenant_id)
menu_permissions
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| menu_id | bigint | no | ||
| permission_id | bigint | no |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (permission_id)btree (menu_id, permission_id) [UNIQUE]
menus
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| name | character varying(50) | no | ||
| title | character varying(50) | no | ||
| icon | character varying(100) | yes | ''::character varying | |
| path | character varying(255) | yes | ''::character varying | |
| component | character varying(255) | yes | ''::character varying | |
| parent_id | bigint | no | 0 | |
| sort | bigint | no | 0 | |
| status | smallint | no | 1 | |
| hidden | smallint | no | 0 | |
| permission | character varying(100) | yes | ''::character varying | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (parent_id)
permissions
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| name | character varying(50) | no | ||
| code | character varying(100) | no | ||
| type | smallint | no | ||
| path | character varying(255) | yes | ''::character varying | |
| method | character varying(10) | yes | ''::character varying | |
| parent_id | bigint | no | 0 | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| description | character varying(255) | no | ''::character varying |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (code) [UNIQUE]btree (parent_id)
role_data_scope_departments
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| role_id | bigint | no | ||
| department_id | bigint | no | ||
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (department_id)btree (role_id, department_id) [UNIQUE]
role_permissions
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| role_id | bigint | no | ||
| permission_id | bigint | no |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (permission_id)btree (role_id, permission_id) [UNIQUE]
roles
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| name | character varying(50) | no | ||
| code | character varying(50) | no | ||
| description | character varying(255) | yes | ''::character varying | |
| data_scope | character varying(32) | no | 'self'::character varying | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| tenant_id | bigint | no | 1 |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (data_scope)btree (tenant_id, code) [UNIQUE]btree (tenant_id)
sys_posts
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| tenant_id | bigint | no | 1 | |
| code | character varying(64) | no | ||
| name | character varying(64) | no | ||
| sort | bigint | no | 0 | |
| status | smallint | no | 1 | |
| remark | character varying(500) | yes | ''::character varying | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (tenant_id)btree (tenant_id, code) [UNIQUE]
sys_user_posts
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| user_id | bigint | no | ||
| post_id | bigint | no |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (post_id)btree (user_id, post_id) [UNIQUE]
user_roles
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| user_id | bigint | no | ||
| role_id | bigint | no |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (role_id)btree (user_id, role_id) [UNIQUE]
users
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| username | character varying(50) | no | ||
| password | character varying(255) | no | ||
| nickname | character varying(50) | yes | ''::character varying | |
| character varying(100) | yes | NULL::character varying | ||
| phone | character varying(20) | yes | NULL::character varying | |
| avatar | character varying(255) | yes | ''::character varying | |
| department_id | bigint | no | 0 | |
| must_change_password | boolean | no | false | |
| status | smallint | no | 1 | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| password_changed_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| totp_secret | character varying(255) | no | ''::character varying | |
| totp_enabled | boolean | no | false | |
| tenant_id | bigint | no | 1 | |
| is_platform_admin | boolean | no | false |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (department_id)btree (tenant_id, email) WHERE ((email IS NOT NULL) AND ((email)::text <> ''::text)) [UNIQUE]btree (tenant_id)btree (tenant_id, phone) WHERE ((phone IS NOT NULL) AND ((phone)::text <> ''::text)) [UNIQUE]btree (tenant_id, username) [UNIQUE]
Auth & Security
console_routes
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| route_key | character varying(64) | no | ||
| path | character varying(255) | no | ||
| name | character varying(128) | no | ||
| component_key | character varying(128) | no | ||
| redirect | character varying(255) | yes | ''::character varying | |
| parent_key | character varying(64) | yes | ''::character varying | |
| sort_order | bigint | yes | 1000 | |
| hidden | boolean | yes | false | |
| public | boolean | yes | false | |
| enabled | boolean | yes | true | |
| permissions_json | jsonb | yes | ||
| roles_json | jsonb | yes | ||
| meta_json | jsonb | yes | ||
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (route_key)
Indexes
btree (enabled)btree (name) [UNIQUE]btree (parent_key)btree (path) [UNIQUE]btree (sort_order)
console_sessions
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| session_id | character varying(64) | no | ||
| username | character varying(128) | no | ||
| issued_at | timestamp(3) with time zone | no | ||
| expires_at | timestamp(3) with time zone | no | ||
| revoked_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| last_seen_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| client_ip_hash | character varying(64) | yes | ''::character varying | |
| user_agent_hash | character varying(64) | yes | ''::character varying | |
| user_agent_preview | character varying(255) | yes | ''::character varying | |
| created_at | timestamp(3) with time zone | no |
Keys & Constraints
PRIMARY KEY (session_id)
Indexes
btree (expires_at)btree (issued_at)btree (revoked_at)btree (username)
oauth_bindings
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| user_id | bigint | no | ||
| provider | character varying(50) | no | ||
| provider_user_id | character varying(100) | no | ||
| access_token | character varying(255) | yes | ''::character varying | |
| refresh_token | character varying(255) | yes | ''::character varying | |
| expires_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (user_id)btree (provider, provider_user_id) [UNIQUE]btree (user_id, provider) [UNIQUE]
password_history
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| user_id | bigint | no | ||
| password_hash | character varying(255) | no | ||
| changed_at | timestamp(3) with time zone | no | ||
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (user_id, changed_at)btree (user_id)
totp_recovery_codes
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| user_id | bigint | no | ||
| code_hash | character varying(255) | no | ||
| used_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADEPRIMARY KEY (id)
Indexes
btree (user_id)btree (user_id, used_at)
Multi-tenancy
tenant_packages
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| name | character varying(128) | no | ||
| permission_codes | jsonb | no | '[]'::jsonb | |
| status | smallint | no | 1 | |
| remark | character varying(255) | no | ''::character varying | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (name) [UNIQUE]
tenants
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| code | character varying(64) | no | ||
| name | character varying(128) | no | ||
| status | smallint | no | 1 | |
| plan | character varying(64) | no | 'free'::character varying | |
| max_users | bigint | no | 0 | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| package_id | bigint | yes |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (code) [UNIQUE]btree (package_id)
System Ops
dict_items
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| dict_type_id | bigint | no | ||
| label | character varying(100) | no | ||
| value | character varying(100) | no | ||
| sort | bigint | yes | 0 | |
| status | smallint | yes | 1 | |
| remark | character varying(255) | yes | ''::character varying | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (dict_type_id)
dict_types
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| name | character varying(100) | no | ||
| code | character varying(100) | no | ||
| description | character varying(255) | yes | ''::character varying | |
| status | smallint | yes | 1 | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (code) [UNIQUE]
error_codes
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| code | character varying(128) | no | ||
| message | character varying(512) | no | ||
| memo | character varying(255) | yes | ''::character varying | |
| scope | character varying(64) | no | 'global'::character varying | |
| status | smallint | yes | 1 | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (code) [UNIQUE]
notices
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| title | character varying(200) | no | ||
| content | text | no | ||
| type | smallint | yes | 1 | |
| status | smallint | yes | 1 | |
| creator_id | bigint | yes | ||
| creator | character varying(50) | yes | ''::character varying | |
| start_time | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| end_time | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| tenant_id | bigint | no | 1 |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (creator_id)btree (tenant_id)
scheduled_job_logs
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| job_id | bigint | no | ||
| job_name | character varying(100) | no | ||
| status | smallint | yes | 1 | |
| message | text | yes | ||
| duration | bigint | yes | 0 | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (created_at)btree (job_id, created_at DESC)
scheduled_jobs
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| name | character varying(100) | no | ||
| group_name | character varying(50) | yes | 'default'::character varying | |
| cron_expression | character varying(50) | no | ||
| invoke_target | character varying(255) | no | ||
| description | character varying(500) | yes | ''::character varying | |
| status | smallint | yes | 1 | |
| concurrent | smallint | yes | 0 | |
| last_run_time | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| next_run_time | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (name) [UNIQUE]
sms_channels
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| tenant_id | bigint | no | 1 | |
| name | character varying(100) | no | ||
| provider | character varying(32) | no | ||
| config | json | yes | ||
| status | smallint | no | 1 | |
| remark | character varying(255) | no | ''::character varying | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (tenant_id)
sms_logs
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| tenant_id | bigint | no | 1 | |
| mobile | character varying(32) | no | ''::character varying | |
| template_code | character varying(100) | no | ''::character varying | |
| content | text | no | ''::text | |
| params | json | yes | ||
| channel_id | bigint | no | 0 | |
| channel_name | character varying(100) | no | ''::character varying | |
| provider | character varying(32) | no | ''::character varying | |
| status | character varying(16) | no | 'sending'::character varying | |
| provider_msg_id | character varying(128) | no | ''::character varying | |
| error | character varying(512) | no | ''::character varying | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (mobile)btree (status)btree (template_code)btree (tenant_id)
sms_templates
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| tenant_id | bigint | no | 1 | |
| code | character varying(100) | no | ||
| name | character varying(100) | no | ||
| channel_id | bigint | no | 0 | |
| content | text | no | ''::text | |
| type | smallint | no | 1 | |
| provider_template_id | character varying(100) | no | ''::character varying | |
| status | smallint | no | 1 | |
| remark | character varying(255) | no | ''::character varying | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (channel_id)btree (tenant_id, code) [UNIQUE]
system_settings
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| setting_key | character varying(128) | no | ||
| value_json | jsonb | yes | ||
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone |
Keys & Constraints
PRIMARY KEY (setting_key)
Indexes
btree (updated_at)
Audit Logs
audit_logs
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| actor_type | character varying(64) | yes | 'operator'::character varying | |
| actor_id | character varying(128) | yes | 'web-console'::character varying | |
| action | character varying(128) | no | ||
| target_type | character varying(64) | no | ||
| target_id | character varying(128) | no | ||
| before_json | jsonb | yes | ||
| after_json | jsonb | yes | ||
| summary | text | yes | ||
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| tenant_id | bigint | no | 1 |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (action)btree (created_at)btree (target_type, target_id, created_at DESC)btree (target_id)btree (tenant_id, created_at DESC)
login_logs
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| user_id | bigint | yes | ||
| username | character varying(50) | yes | ''::character varying | |
| login_type | smallint | yes | 1 | |
| status | smallint | yes | 1 | |
| ip | character varying(45) | yes | ''::character varying | |
| location | character varying(100) | yes | ''::character varying | |
| device | character varying(100) | yes | ''::character varying | |
| os | character varying(50) | yes | ''::character varying | |
| browser | character varying(100) | yes | ''::character varying | |
| user_agent | character varying(500) | yes | ''::character varying | |
| message | character varying(255) | yes | ''::character varying | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| tenant_id | bigint | no | 1 |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (created_at)btree (ip, created_at) WHERE (status = 0)btree (username, created_at) WHERE (status = 0)btree (tenant_id, created_at DESC)btree (user_id, created_at DESC)
operation_logs
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| user_id | bigint | yes | ||
| username | character varying(50) | yes | ''::character varying | |
| actor_type | character varying(64) | yes | 'operator'::character varying | |
| actor_id | character varying(128) | yes | 'web-console'::character varying | |
| request_id | character varying(64) | yes | ''::character varying | |
| module | character varying(50) | yes | ''::character varying | |
| action | character varying(50) | yes | ''::character varying | |
| method | character varying(10) | yes | ''::character varying | |
| path | character varying(255) | yes | ''::character varying | |
| query | character varying(1024) | yes | ''::character varying | |
| request_body | text | yes | ||
| response_body | text | yes | ||
| status | bigint | yes | 0 | |
| ip | character varying(45) | yes | ''::character varying | |
| user_agent | character varying(500) | yes | ''::character varying | |
| latency | bigint | yes | 0 | |
| error_msg | character varying(1024) | yes | ''::character varying | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| tenant_id | bigint | no | 1 |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (created_at)btree (request_id)btree (tenant_id, created_at DESC)btree (user_id, created_at DESC)
File Service
files
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | IDENTITY | |
| user_id | bigint | yes | ||
| file_name | character varying(255) | no | ||
| file_path | character varying(500) | no | ||
| file_size | bigint | no | 0 | |
| file_type | character varying(50) | yes | ''::character varying | |
| mime_type | character varying(100) | yes | ''::character varying | |
| extension | character varying(20) | yes | ''::character varying | |
| storage_type | character varying(20) | yes | 'local'::character varying | |
| url | character varying(500) | yes | ''::character varying | |
| hash | character varying(64) | yes | ''::character varying | |
| created_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| updated_at | timestamp(3) with time zone | yes | NULL::timestamp with time zone | |
| image_width | integer | no | 0 | |
| image_height | integer | no | 0 | |
| thumbnail_path | character varying(500) | yes | ''::character varying | |
| thumbnail_url | character varying(500) | yes | ''::character varying | |
| thumbnail_width | integer | no | 0 | |
| thumbnail_height | integer | no | 0 | |
| tenant_id | bigint | no | 1 |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (hash)btree (tenant_id, created_at DESC)btree (tenant_id, user_id)btree (user_id)
Workflow (BPM)
bpm_cc_record
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | nextval('bpm_cc_record_id_seq'::regclass) | |
| tenant_id | bigint | no | 1 | |
| instance_id | bigint | no | ||
| node_id | character varying(64) | no | ||
| user_id | bigint | no | ||
| read_at | timestamp with time zone | yes | ||
| created_at | timestamp with time zone | yes | ||
| node_name | character varying(128) | no | ''::character varying |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (instance_id)btree (tenant_id, user_id)
bpm_process_definition
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | nextval('bpm_process_definition_id_seq'::regclass) | |
| tenant_id | bigint | no | 1 | |
| key | character varying(64) | no | ||
| version | bigint | no | 1 | |
| name | character varying(128) | no | ||
| status | character varying(16) | no | 'draft'::character varying | |
| node_tree | jsonb | no | ||
| form_schema | jsonb | yes | ||
| biz_type | character varying(32) | yes | ||
| remark | character varying(256) | yes | ||
| created_by | bigint | no | 0 | |
| created_at | timestamp with time zone | yes | ||
| updated_at | timestamp with time zone | yes |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (biz_type)btree (status)btree (tenant_id)btree (tenant_id, key, version) [UNIQUE]
bpm_process_instance
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | nextval('bpm_process_instance_id_seq'::regclass) | |
| tenant_id | bigint | no | 1 | |
| definition_id | bigint | no | ||
| definition_key | character varying(64) | no | ||
| title | character varying(256) | no | ||
| biz_type | character varying(32) | no | ||
| biz_id | character varying(64) | no | ||
| status | character varying(16) | no | 'running'::character varying | |
| current_node_id | character varying(64) | yes | ||
| form_snapshot | jsonb | no | ||
| variables | jsonb | yes | ||
| initiator_id | bigint | no | ||
| initiator_dept | bigint | no | 0 | |
| finished_at | timestamp with time zone | yes | ||
| created_at | timestamp with time zone | yes | ||
| updated_at | timestamp with time zone | yes |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (definition_key)btree (tenant_id, initiator_id, status)btree (tenant_id, status)btree (tenant_id, biz_type, biz_id) WHERE ((status)::text = 'running'::text) [UNIQUE]
bpm_process_log
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | nextval('bpm_process_log_id_seq'::regclass) | |
| tenant_id | bigint | no | 1 | |
| instance_id | bigint | no | ||
| node_id | character varying(64) | yes | ||
| task_id | bigint | no | 0 | |
| action | character varying(32) | no | ||
| operator_id | bigint | no | 0 | |
| detail | jsonb | yes | ||
| created_at | timestamp with time zone | yes |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (tenant_id)btree (instance_id, created_at)
bpm_task
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | bigint | no | nextval('bpm_task_id_seq'::regclass) | |
| tenant_id | bigint | no | 1 | |
| instance_id | bigint | no | ||
| node_id | character varying(64) | no | ||
| node_name | character varying(128) | no | ||
| round | bigint | no | 1 | |
| assignee_id | bigint | no | ||
| origin_assignee | bigint | no | 0 | |
| multi_mode | character varying(8) | no | 'OR'::character varying | |
| seq_order | bigint | no | 0 | |
| status | character varying(16) | no | 'pending'::character varying | |
| comment | character varying(512) | yes | ||
| timeout_at | timestamp with time zone | yes | ||
| reminded_at | timestamp with time zone | yes | ||
| acted_at | timestamp with time zone | yes | ||
| created_at | timestamp with time zone | yes | ||
| updated_at | timestamp with time zone | yes |
Keys & Constraints
PRIMARY KEY (id)
Indexes
btree (origin_assignee)btree (instance_id, node_id, round)btree (tenant_id, assignee_id, status)
Migration Meta
goose_db_version
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| id | integer | no | IDENTITY | |
| version_id | bigint | no | ||
| is_applied | boolean | no | ||
| tstamp | timestamp without time zone | no | now() |
Keys & Constraints
PRIMARY KEY (id)
schema_migrations
| Column | Type | Nullable | Default | Comment |
|---|---|---|---|---|
| version | character varying(255) | no | ||
| checksum | character varying(64) | yes | ''::character varying | |
| applied_at | timestamp with time zone | no | CURRENT_TIMESTAMP |
Keys & Constraints
PRIMARY KEY (version)