-- 基本テーブル定義例（予約システム用）
CREATE TABLE IF NOT EXISTS reservations (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100),
    phone VARCHAR(20),
    email VARCHAR(200),
    menu VARCHAR(100),
    staff VARCHAR(100),
    start_time DATETIME,
    status VARCHAR(50),
    source_id INT,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS form_fields (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100),
    label VARCHAR(100),
    sort_order INT DEFAULT 0
);

CREATE TABLE IF NOT EXISTS reservation_sources (
    id INT AUTO_INCREMENT PRIMARY KEY,
    code VARCHAR(50),
    display_name VARCHAR(100)
);

CREATE TABLE IF NOT EXISTS settings (
    id INT PRIMARY KEY DEFAULT 1,
    api_key TEXT,
    device_id TEXT
);
