CREATE TABLE hrsa_auth_data
(
    id           bigint(0) NOT NULL,
    role_id      bigint(0) NOT NULL,
    link         int(0) NOT NULL,
    target_type  int(0) NOT NULL,
    target       varchar(4000),
    target_name  varchar(4000),
    sorted_index int(0) NOT NULL,
    creator      bigint(0) NOT NULL,
    create_time  datetime(0) NOT NULL,
    update_time  datetime(0) NOT NULL,
    delete_type  int(0) NOT NULL,
    tenant_key   varchar(10),
    PRIMARY KEY (id) USING BTREE
);



CREATE TABLE hrsa_auth_member
(
    id          bigint(0) NOT NULL,
    role_id     bigint(0) NOT NULL,
    target_type int(0) NOT NULL,
    target      varchar(4000) NOT NULL,
    target_name varchar(4000) NOT NULL,
    creator     bigint(0) NOT NULL,
    create_time datetime(0) NOT NULL,
    update_time datetime(0) NOT NULL,
    delete_type int(0) NOT NULL,
    tenant_key  varchar(10),
    PRIMARY KEY (id) USING BTREE
);


CREATE TABLE hrsa_auth_opt
(
    id          bigint(0) NOT NULL,
    role_id     bigint(0) NOT NULL,
    page        varchar(200) NOT NULL,
    opt         varchar(200) NOT NULL,
    creator     bigint(0) NOT NULL,
    create_time datetime(0) NOT NULL,
    update_time datetime(0) NOT NULL,
    delete_type int(0) NOT NULL,
    tenant_key  varchar(10),
    PRIMARY KEY (id) USING BTREE
);


CREATE TABLE hrsa_auth_role
(
    id           bigint(0) NOT NULL,
    tax_agent_id bigint(0) NOT NULL,
    name         varchar(255) NOT NULL,
    description  varchar(400),
    creator      bigint(0) NOT NULL,
    create_time  datetime(0) NOT NULL,
    update_time  datetime(0) NOT NULL,
    delete_type  int(0) NOT NULL,
    tenant_key   varchar(10)  NOT NULL,
    PRIMARY KEY (id) USING BTREE
);


CREATE TABLE hrsa_auth_role_data
(
    id          bigint(0) NOT NULL,
    role_id     bigint(0) NOT NULL,
    employee_id bigint(0) NOT NULL,
    creator     bigint(0) NOT NULL,
    create_time datetime(0) NOT NULL,
    update_time datetime(0) NOT NULL,
    delete_type int(0) NOT NULL,
    tenant_key  varchar(10) NOT NULL,
    PRIMARY KEY (id) USING BTREE
);


CREATE TABLE hrsa_auth_role_emp
(
    id          bigint(0) NOT NULL,
    role_id     bigint(0) NOT NULL,
    employee_id bigint(0) NOT NULL,
    creator     bigint(0) NOT NULL,
    create_time datetime(0) NOT NULL,
    update_time datetime(0) NOT NULL,
    delete_type int(0) NOT NULL,
    tenant_key  varchar(10) NOT NULL,
    PRIMARY KEY (id) USING BTREE
);


CREATE TABLE hrsa_auth_resource
(
    id          bigint(0) NOT NULL,
    role_id     bigint(0) NOT NULL,
    target_type int(0) NOT NULL,
    target      bigint(0) NOT NULL,
    target_name varchar(255),
    creator     bigint(0) NOT NULL,
    create_time datetime(0) NOT NULL,
    update_time datetime(0) NOT NULL,
    delete_type int(0) NOT NULL,
    tenant_key  varchar(10),
    PRIMARY KEY (id) USING BTREE
);


CREATE TABLE hrsa_sob_tax_link
(
    id           bigint(0) NOT NULL,
    sob_id       bigint(0) NOT NULL,
    tax_agent_id bigint(0) NOT NULL,
    creator      bigint(0) NOT NULL,
    create_time  datetime(0) NOT NULL,
    update_time  datetime(0) NOT NULL,
    delete_type  int(0) NOT NULL,
    tenant_key   varchar(10) ,
    PRIMARY KEY (id) USING BTREE
) ;
