-- V11: User settings - preferensi personal user (TTS, haptic, dll)
CREATE TABLE IF NOT EXISTS user_settings (
    id               BIGSERIAL        PRIMARY KEY,
    user_id          BIGINT           NOT NULL UNIQUE REFERENCES users(id) ON DELETE CASCADE,
    tts_language     VARCHAR(10)      NOT NULL DEFAULT 'id-ID',
    tts_pitch        DOUBLE PRECISION NOT NULL DEFAULT 1.0,
    tts_speed        DOUBLE PRECISION NOT NULL DEFAULT 0.9,
    warn_no_guardian BOOLEAN          NOT NULL DEFAULT TRUE,
    haptic_enabled   BOOLEAN          NOT NULL DEFAULT TRUE,
    updated_at       TIMESTAMP        NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_user_settings_user_id ON user_settings(user_id);
