create table central.product
(
    id           int auto_increment
        primary key,
    name         varchar(255)  not null,
    product_code varchar(255)  not null,
    remark       varchar(255)  null,
    create_time  datetime      not null,
    update_time  datetime      not null,
    status       int default 0 not null,
    constraint product_code_unique
        unique (product_code)
);


alter table app
    add app_key varchar(64) null after package_name;

alter table app
    add app_secret varchar(512) null after app_key;

alter table app
    add verify_status int default 0 not null after app_secret;

alter table app
    add product_code varchar(255) null after verify_status;

alter table app
    alter column status set default 0;

alter table app
    add project_code varchar(255) null after product_code;

alter table app
    add constraint env_package_platform_unique
        unique (env, package_name, app_platform);


alter table app_package
    add remark varchar(255) null after package_name;


alter table channel
    add remark varchar(255) null after channel_name;

alter table channel
    add constraint channel_name_unique
        unique (channel_name);

alter table channel
drop key project_code_unique;


alter table project
    add access_key varchar(255) null after project_code;

alter table project
    add access_secret varchar(255) null after access_key;

alter table project
    add notify_url varchar(255) null after access_secret;

alter table project
    add remark varchar(255) null after notify_url;

alter table project
    add constraint project_code_unique
        unique (project_code);
