create index idx_out_trade_no_expire_time
    on pay_renew (out_trade_no asc, expire_time desc);

create index idx_out_trade_no_status_create_time
    on pay_renew (out_trade_no asc, status asc, create_time desc);


create table promotion_agent
(
    id          bigint auto_increment
        primary key,
    agent_name  varchar(255) null,
    remark      varchar(255) null,
    create_time datetime default CURRENT_TIMESTAMP not null,
    update_time datetime default CURRENT_TIMESTAMP not null,
    status      int      default 0                 not null
);

alter table promotion_advertiser
    add agent_id bigint null;