-- Günlük yemek menüsü (tenant başına tarih başına tek satır). Prisma: 20260408120000_meal_menus

CREATE TABLE IF NOT EXISTS meal_menus (
    id TEXT PRIMARY KEY,
    tenant_id TEXT NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
    menu_date DATE NOT NULL,
    breakfast TEXT,
    lunch TEXT,
    afternoon_snack TEXT,
    created_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created_by_user_id TEXT REFERENCES users(id) ON DELETE SET NULL
);

CREATE UNIQUE INDEX IF NOT EXISTS meal_menus_tenant_id_menu_date_key ON meal_menus (tenant_id, menu_date);
CREATE INDEX IF NOT EXISTS meal_menus_tenant_id_menu_date_idx ON meal_menus (tenant_id, menu_date);
