create table fox_account
(
    id                 bigint auto_increment
        primary key,
    account            varchar(255)     null,
    endpoint           varchar(255)     null,
    api_key            varchar(255)     not null,
    expired            int(2) default 0 not null,
    songs_left         int    default 0 not null,
    points_update_time datetime         null,
    status             int    default 0 not null
);

create table fox_song
(
    song_id         varchar(64)               not null
        primary key,
    video_url       varchar(255)              null,
    audio_url       varchar(255)              null,
    image_url       varchar(255)              null,
    image_large_url varchar(255)              null,
    model_name      varchar(255)              null,
    user_id         varchar(64)               null,
    status          varchar(64)               null,
    title           varchar(255)              null,
    meta_tags       varchar(255)               null,
    meta_prompt     varchar(5000) default '0' null,
    meta_duration   double        default 0   null,
    meta_error_msg  varchar(255)  default '0' null,
    meta_error_type varchar(255)              null,
    created_time    datetime                  not null on update CURRENT_TIMESTAMP
);

create table fox_song_generate_log
(
    task_id      varchar(64)      not null
        primary key,
    user_id      varchar(64)      null,
    ssid         varchar(64)      null,
    device_id    varchar(64)      null,
    phone        varchar(32)      null,
    prompt       varchar(5000)    null,
    custom       int(2)           null,
    tags         varchar(1000)    null,
    instrumental int(2) default 0 null,
    title        varchar(1000)    null,
    description  varchar(1000)    null,
    song_id      varchar(255)     null,
    start_time   datetime         null,
    send_time    datetime         null,
    handle_time  datetime         null,
    finish_time  datetime         null,
    fail_reason  varchar(5000)    null
);

