drop table if exists b_finance_auto; create table b_finance_auto ( id bigint primary key, family_id bigint not null, type smallint not null, category_id bigint not null, amount numeric(12,2) not null, remark varchar(255) default '', repeat_type smallint not null, repeat_date varchar(64) default '', last_run date, status smallint not null default 1, create_time timestamptz, update_time timestamptz, create_by bigint, update_by bigint ); create index idx_b_finance_auto_family on b_finance_auto (family_id, status);