chenhj
8 天以前 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
-- ----------------------------
-- 19、代码生成业务表字段
-- ----------------------------
 
drop table if exists gen_table_column;
create table gen_table_column
(
    column_id      serial primary key,                     -- 使用 serial 实现自增
    table_id       bigint,                                 -- 归属表编号
    column_name    varchar(200),                           -- 列名称
    column_comment varchar(500),                           -- 列描述
    column_type    varchar(100),                           -- 列类型
    java_type      varchar(500),                           -- JAVA类型
    java_field     varchar(200),                           -- JAVA字段名
    is_pk          char(1),                                -- 是否主键(1是)
    is_increment   char(1),                                -- 是否自增(1是)
    is_required    char(1),                                -- 是否必填(1是)
    is_insert      char(1),                                -- 是否为插入字段(1是)
    is_edit        char(1),                                -- 是否编辑字段(1是)
    is_list        char(1),                                -- 是否列表字段(1是)
    is_query       char(1),                                -- 是否查询字段(1是)
    query_type     varchar(200) default 'EQ',              -- 查询方式(等于、不等于、大于、小于、范围)
    html_type      varchar(200),                           -- 显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)
    dict_type      varchar(200) default '',                -- 字典类型
    sort           int,                                    -- 排序
    create_by      varchar(64)  default '',                -- 创建者
    create_time    timestamp    default current_timestamp, -- 创建时间
    update_by      varchar(64)  default '',                -- 更新者
    update_time    timestamp,                              -- 更新时间
    foreign key (table_id) references gen_table (table_id) -- 外键约束
);
 
-- 表注释
comment on table gen_table_column is '代码生成业务表字段';
 
-- 字段注释
comment on column gen_table_column.column_id is '编号';
comment on column gen_table_column.table_id is '归属表编号';
comment on column gen_table_column.column_name is '列名称';
comment on column gen_table_column.column_comment is '列描述';
comment on column gen_table_column.column_type is '列类型';
comment on column gen_table_column.java_type is 'JAVA类型';
comment on column gen_table_column.java_field is 'JAVA字段名';
comment on column gen_table_column.is_pk is '是否主键(1是)';
comment on column gen_table_column.is_increment is '是否自增(1是)';
comment on column gen_table_column.is_required is '是否必填(1是)';
comment on column gen_table_column.is_insert is '是否为插入字段(1是)';
comment on column gen_table_column.is_edit is '是否编辑字段(1是)';
comment on column gen_table_column.is_list is '是否列表字段(1是)';
comment on column gen_table_column.is_query is '是否查询字段(1是)';
comment on column gen_table_column.query_type is '查询方式(等于、不等于、大于、小于、范围)';
comment on column gen_table_column.html_type is '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)';
comment on column gen_table_column.dict_type is '字典类型';
comment on column gen_table_column.sort is '排序';
comment on column gen_table_column.create_by is '创建者';
comment on column gen_table_column.create_time is '创建时间';
comment on column gen_table_column.update_by is '更新者';
comment on column gen_table_column.update_time is '更新时间';