import { i as getAccountDb } from "./account-db-Ou9GhEjB.js";
//#region migrations/1718889148000-openid.js
var up = async function() {
	await getAccountDb().exec(`
    BEGIN TRANSACTION;
     CREATE TABLE auth_new
        (method TEXT PRIMARY KEY,
        display_name TEXT,
        extra_data TEXT, active INTEGER);

    INSERT INTO auth_new (method, display_name, extra_data, active)
      SELECT 'password', 'Password', password, 1 FROM auth;
        DROP TABLE auth;
        ALTER TABLE auth_new RENAME TO auth;

    CREATE TABLE pending_openid_requests
      (state TEXT PRIMARY KEY,
      code_verifier TEXT,
      return_url TEXT,
      expiry_time INTEGER);
    COMMIT;`);
};
var down = async function() {
	await getAccountDb().exec(`
    BEGIN TRANSACTION;
    ALTER TABLE auth RENAME TO auth_temp;
    CREATE TABLE auth
        (password TEXT);
    INSERT INTO auth (password)
      SELECT extra_data FROM auth_temp WHERE method = 'password';
    DROP TABLE auth_temp;

    DROP TABLE pending_openid_requests;
    COMMIT;
      `);
};
//#endregion
export { down, up };

//# sourceMappingURL=1718889148000-openid-tdfWy5E-.js.map