-- 公式
CREATE TABLE hrsa_formula
(
    id               bigint identity(1,1) PRIMARY KEY,
    name             varchar(255)  NOT NULL,
    description      varchar(255) DEFAULT NULL,
    module           varchar(255)  NOT NULL,
    use_for          varchar(255) DEFAULT NULL,
    reference_type   varchar(255) DEFAULT NULL,
    return_type      varchar(255)  NOT NULL,
    validate_type    varchar(255)  NOT NULL,
    extend_param     varchar(255) DEFAULT NULL,
    formula          varchar(4000) NOT NULL,
    formulaRunScript varchar(4000) NOT NULL,
    creator          bigint        NOT NULL,
    delete_type      int           NOT NULL,
    create_time      datetime      NOT NULL,
    update_time      datetime      NOT NULL
);

CREATE TABLE hrsa_formula_var
(
    id          bigint identity (1,1) PRIMARY KEY,
    name        varchar(255) NOT NULL,
    formula_id  bigint       NOT NULL,
    field_id    varchar(255) NOT NULL,
    field_name  varchar(500) NOT NULL,
    field_type  varchar(255) NOT NULL,
    source      varchar(255) NOT NULL,
    order_index int          NOT NULL,
    creator     bigint       NOT NULL,
    delete_type int          NOT NULL,
    create_time datetime     NOT NULL,
    update_time datetime     NOT NULL
);


ALTER TABLE hrsa_salary_sob_default_item ADD  sob_default_item_group_id bigint NOT NULL ;
ALTER TABLE hrsa_salary_sob_default_item ADD  sorted_index int NOT NULL ;