CREATE TABLE IF NOT EXISTS ai.tb_ai_model_config (
    model_id         VARCHAR(64) PRIMARY KEY,
    model_name       VARCHAR(128) NOT NULL,
    provider         VARCHAR(64) NOT NULL,
    endpoint         VARCHAR(255),
    province_code    VARCHAR(12),
    area_code        VARCHAR(12),
    tenant_id        VARCHAR(64),
    tenant_path      VARCHAR(255),
    dept_id          VARCHAR(64),
    dept_path        VARCHAR(255),
    created_at       TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS ai.tb_ai_task_log (
    task_id          VARCHAR(64) PRIMARY KEY,
    task_type        VARCHAR(64) NOT NULL,
    task_status      VARCHAR(32) NOT NULL,
    province_code    VARCHAR(12),
    area_code        VARCHAR(12),
    tenant_id        VARCHAR(64),
    tenant_path      VARCHAR(255),
    dept_id          VARCHAR(64),
    dept_path        VARCHAR(255),
    payload_json     TEXT,
    created_at       TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
