CREATE DATABASE IF NOT EXISTS api_debug;

USE api_debug;

CREATE TABLE IF NOT EXISTS tenants (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_id VARCHAR(50) DEFAULT 'admin', -- 暂时默认为 admin，后续可扩展用户系统
    name VARCHAR(100) NOT NULL,
    type ENUM('旗舰版PP', '旗舰版ATS', '标品ATS', '标品PP', '国际版ATS') NOT NULL,
    app_key VARCHAR(100),
    app_secret VARCHAR(100),
    api_key VARCHAR(100),
    ent_code VARCHAR(100),
    bu_id VARCHAR(100),
    ent_id VARCHAR(100),
    private_key TEXT,
    public_key TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
