/**
 * Migration 049: Add user_preferred_language column to settings.
 *
 * Stores the user's preferred UI language as an ISO 639-1 code.
 * Defaults to 'en' (English) for backward compatibility with
 * existing installations.
 *
 * Supported values: en, ru, pt, es, ar, he, fr, de
 */
export async function up({ context: db }) {
    const columns = db.pragma('table_info(settings)');
    const names = new Set(columns.map((c) => c.name));
    if (!names.has('user_preferred_language')) {
        db.exec(`ALTER TABLE settings ADD COLUMN user_preferred_language TEXT NOT NULL DEFAULT 'en'`);
    }
}
export async function down({ context: db }) {
    void db;
}
