chenhj
10 天以前 2db123a855bd3bb2182714cd15a9446987b0e7ae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
-- ----------------------------
-- 11、字典类型表
-- ----------------------------
 
drop table if exists sys_dict_type;
create table sys_dict_type
(
    dict_id     serial primary key,       -- PostgreSQL 使用 serial 来实现自增
    dict_name   varchar(100) default '',  -- 默认值和字段类型保持一致
    dict_type   varchar(100) default '',  -- 字典类型
    status      char(1)      default '0', -- 默认值为 '0'
    create_by   varchar(64)  default '',  -- 创建者
    create_time timestamp,                -- PostgreSQL 使用 timestamp 代替 datetime
    update_by   varchar(64)  default '',  -- 更新者
    update_time timestamp,                -- 更新时间
    remark      varchar(500),             -- 备注,可以为 null
    unique (dict_type)                    -- 唯一约束
);
 
-- 初始化数据插入
insert into sys_dict_type (dict_id, dict_name, dict_type, status, create_by, create_time, update_by, update_time,
                           remark)
values (1, '用户性别', 'sys_user_sex', '0', 'admin', current_timestamp, '', null, '用户性别列表'),
       (2, '菜单状态', 'sys_show_hide', '0', 'admin', current_timestamp, '', null, '菜单状态列表'),
       (3, '系统开关', 'sys_normal_disable', '0', 'admin', current_timestamp, '', null, '系统开关列表'),
       (4, '任务状态', 'sys_job_status', '0', 'admin', current_timestamp, '', null, '任务状态列表'),
       (5, '任务分组', 'sys_job_group', '0', 'admin', current_timestamp, '', null, '任务分组列表'),
       (6, '系统是否', 'sys_yes_no', '0', 'admin', current_timestamp, '', null, '系统是否列表'),
       (7, '通知类型', 'sys_notice_type', '0', 'admin', current_timestamp, '', null, '通知类型列表'),
       (8, '通知状态', 'sys_notice_status', '0', 'admin', current_timestamp, '', null, '通知状态列表'),
       (9, '操作类型', 'sys_oper_type', '0', 'admin', current_timestamp, '', null, '操作类型列表'),
       (10, '系统状态', 'sys_common_status', '0', 'admin', current_timestamp, '', null, '登录状态列表');