export async function up({ context: db }) {
    const columns = db.pragma('table_info(settings)');
    if (!columns.some((c) => c.name === 'env_terminal_preference')) {
        db.exec("ALTER TABLE settings ADD COLUMN env_terminal_preference TEXT NOT NULL DEFAULT 'system'");
    }
}
export async function down({ context: db }) {
    // SQLite does not support DROP COLUMN before version 3.35.0.
    // For safety we recreate the table without the column.
    // However, since this is a simple addition and we guard with IF NOT EXISTS
    // in `up`, a no-op down is acceptable for this migration.
    void db;
}
