create table sys_role
(
    id          bigint generated by default as identity
        constraint _copy_6
            primary key,
    name        varchar(50) not null,
    create_by   varchar(50),
    update_by   varchar(50),
    create_time timestamp(6),
    update_time timestamp(6),
    enabled     boolean,
    remark      varchar(255),
    data_scope  integer,
    create_id   bigint,
    dept_id     bigint
);

comment on table sys_role is '角色表';

comment on column sys_role.id is 'ID';

comment on column sys_role.name is '名称';

comment on column sys_role.create_by is '创建者';

comment on column sys_role.update_by is '更新者';

comment on column sys_role.create_time is '创建日期';

comment on column sys_role.update_time is '更新时间';

comment on column sys_role.enabled is '状态';

comment on column sys_role.data_scope is '数据权限范围';

comment on column sys_role.create_id is '创建者id';

comment on column sys_role.dept_id is '部门权限';

alter table sys_role
    owner to gitea;

create index role_name_index
    on sys_role (name);

