CREATE TABLE hrsa_auth_data
(
    id           NUMBER(38,0) primary key NOT NULL,
    role_id      NUMBER(38,0) NOT NULL,
    link         number NOT NULL,
    target_type  number NOT NULL,
    target       varchar2(4000),
    target_name  varchar2(4000),
    sorted_index number NOT NULL,
    creator      NUMBER(38,0) NOT NULL,
    create_time  DATE NOT NULL,
    update_time  DATE NOT NULL,
    delete_type  number NOT NULL,
    tenant_key   varchar2(10)
);
/

CREATE TABLE hrsa_auth_member
(
    id               NUMBER(38,0) primary key NOT NULL,
    role_id     NUMBER(38,0) NOT NULL,
    target_type number NOT NULL,
    target      varchar2(4000) NOT NULL,
    target_name varchar2(4000) NOT NULL,
    creator     NUMBER(38,0) NOT NULL,
    create_time DATE NOT NULL,
    update_time DATE NOT NULL,
    delete_type number NOT NULL,
    tenant_key  varchar2(10)
);
/

CREATE TABLE hrsa_auth_opt
(
    id               NUMBER(38,0) primary key NOT NULL,
    role_id     NUMBER(38,0) NOT NULL,
    page        varchar2(200) NOT NULL,
    opt         varchar2(200) NOT NULL,
    creator     NUMBER(38,0) NOT NULL,
    create_time DATE NOT NULL,
    update_time DATE NOT NULL,
    delete_type number NOT NULL,
    tenant_key  varchar2(10)
);
/

CREATE TABLE hrsa_auth_role
(
    id               NUMBER(38,0) primary key NOT NULL,
    name         varchar2(255) NOT NULL,
    description  varchar2(400),
    creator      NUMBER(38,0) NOT NULL,
    create_time  DATE NOT NULL,
    update_time  DATE NOT NULL,
    delete_type  number NOT NULL,
    tenant_key   varchar2(10)  NOT NULL
);
/

CREATE TABLE hrsa_auth_role_data
(
    id               NUMBER(38,0) primary key NOT NULL,
    role_id     NUMBER(38,0) NOT NULL,
    employee_id NUMBER(38,0) NOT NULL,
    creator     NUMBER(38,0) NOT NULL,
    create_time DATE NOT NULL,
    update_time DATE NOT NULL,
    delete_type number NOT NULL,
    tenant_key  varchar2(10) NOT NULL
);
/

CREATE TABLE hrsa_auth_role_emp
(
    id               NUMBER(38,0) primary key NOT NULL,
    role_id     NUMBER(38,0) NOT NULL,
    employee_id NUMBER(38,0) NOT NULL,
    creator     NUMBER(38,0) NOT NULL,
    create_time DATE NOT NULL,
    update_time DATE NOT NULL,
    delete_type number NOT NULL,
    tenant_key  varchar2(10) NOT NULL
);
/

CREATE TABLE hrsa_auth_resource
(
    id               NUMBER(38,0) primary key NOT NULL,
    role_id     NUMBER(38,0) NOT NULL,
    target_type number NOT NULL,
    target      NUMBER(38,0) NOT NULL,
    target_name varchar2(255),
    creator     NUMBER(38,0) NOT NULL,
    create_time DATE NOT NULL,
    update_time DATE NOT NULL,
    delete_type number NOT NULL,
    tenant_key  varchar2(10)
);
/

CREATE TABLE hrsa_sob_tax_link
(
    id               NUMBER(38,0) primary key NOT NULL,
    sob_id       NUMBER(38,0) NOT NULL,
    tax_agent_id NUMBER(38,0) NOT NULL,
    creator      NUMBER(38,0) NOT NULL,
    create_time  DATE NOT NULL,
    update_time  DATE NOT NULL,
    delete_type  number NOT NULL,
    tenant_key   varchar2(10)
);
/

