CREATE TABLE IF NOT EXISTS customer_scripts
(
    id BIGINT NOT NULL,
    title VARCHAR(200) NOT NULL,
    category VARCHAR(64),
    scene VARCHAR(200),
    target_role VARCHAR(64),
    trigger_keywords TEXT,
    reply_template TEXT,
    handoff_rule TEXT,
    tags VARCHAR(255),
    updated_by VARCHAR(64),
    status VARCHAR(32) NOT NULL DEFAULT '待审核',
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    deleted_at TIMESTAMP,
    PRIMARY KEY (id),
    KEY idx_customer_scripts_category_status (category, status),
    KEY idx_customer_scripts_status_updated (status, updated_at)
);
