{ "(repeated)": [ {"sql":"-- The record of the auth store's steps.\ncreate table if not exists \"auth_steps\" (\n \"module\" text not null,\n \"step\" integer not null,\n \"target\" text not null,\n \"applied_at\" timestamptz,\n primary key (\"module\", \"step\", \"target\")\n);\n\n-- auth 1 core: Better Auth's users, sessions, accounts, verifications and signing keys.\ncreate table if not exists \"user\" (id text primary key);\n\nalter table \"user\"\n add column if not exists \"name\" text not null,\n add column if not exists \"email\" text not null unique,\n add column if not exists \"email_verified\" boolean not null,\n add column if not exists \"image\" text,\n add column if not exists \"created_at\" timestamptz default current_timestamp not null,\n add column if not exists \"updated_at\" timestamptz default current_timestamp not null,\n add column if not exists \"role\" text,\n add column if not exists \"banned\" boolean,\n add column if not exists \"ban_reason\" text,\n add column if not exists \"ban_expires\" timestamptz,\n add column if not exists \"last_role\" text,\n add column if not exists \"email_confirmed_at\" timestamptz;\n\ncreate table \"session\" (\n id text primary key,\n \"expires_at\" timestamptz not null,\n \"token\" text not null unique,\n \"created_at\" timestamptz default current_timestamp not null,\n \"updated_at\" timestamptz not null,\n \"ip_address\" text,\n \"user_agent\" text,\n \"user_id\" text not null references \"user\" (id) on delete cascade,\n \"impersonated_by\" text,\n \"active_role\" text\n);\n\ncreate index \"session_user_id_idx\" on \"session\" (\"user_id\");\n\ncreate table \"account\" (\n id text primary key,\n \"account_id\" text not null,\n \"provider_id\" text not null,\n \"user_id\" text not null references \"user\" (id) on delete cascade,\n \"access_token\" text,\n \"refresh_token\" text,\n \"id_token\" text,\n \"access_token_expires_at\" timestamptz,\n \"refresh_token_expires_at\" timestamptz,\n \"scope\" text,\n \"password\" text,\n \"created_at\" timestamptz default current_timestamp not null,\n \"updated_at\" timestamptz not null\n);\n\ncreate index \"account_user_id_idx\" on \"account\" (\"user_id\");\n\ncreate table \"verification\" (\n id text primary key,\n \"identifier\" text not null,\n \"value\" text not null,\n \"expires_at\" timestamptz not null,\n \"created_at\" timestamptz default current_timestamp not null,\n \"updated_at\" timestamptz default current_timestamp not null\n);\n\ncreate index \"verification_identifier_idx\" on \"verification\" (\"identifier\");\n\ncreate table \"jwks\" (\n id text primary key,\n \"public_key\" text not null,\n \"private_key\" text not null,\n \"created_at\" timestamptz not null,\n \"expires_at\" timestamptz,\n \"alg\" text,\n \"crv\" text\n);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 1, 'auth', now());\n\n-- auth 2 account_keys: One account per provider and account id, and per person where a provider links one.\ndo $check$\ndeclare\n found text;\nbegin\n select string_agg(format('%s %s (accounts %s)', provider, subject, ids), '; ') into found\n from (\n select \"provider_id\" as provider, \"account_id\" as subject, string_agg(id::text, ', ' order by id) as ids\n from \"account\" group by \"provider_id\", \"account_id\" having count(*) > 1 order by 1, 2 limit 20\n ) as twice;\n if found is not null then\n raise exception 'The auth store has more than one account for a provider and account id: %. Keep one of each in a migration of the project''s own written before this one, then apply again.', found;\n end if;\nend\n$check$;\n\ncreate unique index \"account_provider_id_account_id_uidx\" on \"account\" (\"provider_id\", \"account_id\");\n\nalter table \"account\" add column \"single_subject_user_id\" text;\n\ncreate unique index \"account_provider_id_single_subject_user_id_uidx\" on \"account\" (\"provider_id\", \"single_subject_user_id\");\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 2, 'auth', now());\n\n-- auth 3 user_indexes: The indexes that find the active admins and page through the users.\ncreate index if not exists \"user_active_admin_idx\" on \"user\" (id) where \"banned\" is not true and 'admin' = any(regexp_split_to_array(regexp_replace(regexp_replace(coalesce(\"role\", 'user'), '^\\s*\\{(.*)\\}\\s*$', '\\1'), '^\\s*\"?|\"?\\s*$', '', 'g'), '\"?\\s*,\\s*\"?'));\n\ncreate index if not exists \"user_created_at_id_idx\" on \"user\" (\"created_at\", id);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 3, 'auth', now());\n\n-- auth 4 verification_pattern_index: The index that finds app invitations.\ncreate index \"verification_identifier_pattern_idx\" on \"verification\" (\"identifier\" text_pattern_ops);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 4, 'auth', now());\n\n-- auth 5 user_name_search: The indexes that find the users by a part of their name and list them by name.\ncreate extension if not exists pg_trgm;\n\ncreate index if not exists \"user_name_id_idx\" on \"user\" (\"name\", id);\n\ncreate index if not exists \"user_name_trgm_idx\" on \"user\" using gin (\"name\" gin_trgm_ops);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 5, 'auth', now());\n\n-- auth 6 drop_version_record: The drop of the former record of versions, which auth_steps replaced.\ndrop table if exists \"auth_migrations\";\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 6, 'auth', now());\n\n-- auth 7 token_revocations: The token revocations, and the triggers that write them as sessions end and users change.\ncreate table \"token_revocation\" (\n id bigint generated always as identity primary key,\n \"user_id\" text not null,\n \"session_id\" text,\n \"rev\" bigint not null,\n \"revoked_at\" timestamptz not null,\n \"visible_since\" timestamptz\n);\n\ncreate index \"token_revocation_visible_since_idx\" on \"token_revocation\" (\"visible_since\");\n\ncreate table \"token_revision\" (\n id text primary key,\n \"rev\" bigint not null\n);\n\ncreate function \"token_revocation_revoke\"(users text[], sessions text[]) returns void language plpgsql as $$\ndeclare\n attempt integer := 0;\nbegin\n if cardinality(users) = 0 then\n return;\n end if;\n loop\n begin\n with raised as (\n insert into \"token_revision\" (id, \"rev\")\n select raising.id, 1 from (select distinct one.user_id as id from unnest(users) as one (user_id)) as raising order by raising.id\n on conflict (id) do update set \"rev\" = \"token_revision\".\"rev\" + 1\n -- Named with the table, as a column may have the name of one of this function's variables.\n returning \"token_revision\".id, \"token_revision\".\"rev\" as rev\n )\n insert into \"token_revocation\" (\"user_id\", \"session_id\", \"rev\", \"revoked_at\")\n select one.user_id, one.session_id, raised.rev, pg_catalog.clock_timestamp() from unnest(users, sessions) as one (user_id, session_id) join raised on raised.id = one.user_id;\n exit;\n exception when deadlock_detected or serialization_failure then\n attempt := attempt + 1;\n if attempt >= 5 then\n raise;\n end if;\n -- The transaction this one gave way to takes the rows first.\n perform pg_catalog.pg_sleep(0.1 * attempt);\n end;\n end loop;\nend\n$$;\n\ncreate function \"token_revocation_session_ended\"() returns trigger language plpgsql as $$\nbegin\n perform \"token_revocation_revoke\"(revoked.users, revoked.sessions) from (select coalesce(array_agg(one.user_id), '{}') as users, coalesce(array_agg(one.session_id), '{}') as sessions from (select ended.\"user_id\"::text, ended.id::text from ended) as one (user_id, session_id)) as revoked;\n return null;\nend\n$$;\n\ncreate trigger \"token_revocation_session_ended\" after delete on \"session\" referencing old table as ended for each statement execute function \"token_revocation_session_ended\"();\n\ncreate function \"token_revocation_user_changed\"() returns trigger language plpgsql as $$\nbegin\n perform \"token_revocation_revoke\"(revoked.users, revoked.sessions) from (select coalesce(array_agg(one.user_id), '{}') as users, coalesce(array_agg(one.session_id), '{}') as sessions from (select changed.id::text, null::text from was join changed on changed.id = was.id\n where was.\"role\" is distinct from changed.\"role\" or was.\"banned\" is distinct from changed.\"banned\" or was.\"ban_expires\" is distinct from changed.\"ban_expires\") as one (user_id, session_id)) as revoked;\n return null;\nend\n$$;\n\ncreate trigger \"token_revocation_user_changed\" after update on \"user\" referencing old table as was new table as changed for each statement execute function \"token_revocation_user_changed\"();\n\ncreate function \"token_revocation_users_deleted\"() returns trigger language plpgsql as $$\nbegin\n perform \"token_revocation_revoke\"(revoked.users, revoked.sessions) from (select coalesce(array_agg(one.user_id), '{}') as users, coalesce(array_agg(one.session_id), '{}') as sessions from (select gone.id::text, null::text from gone) as one (user_id, session_id)) as revoked;\n return null;\nend\n$$;\n\ncreate trigger \"token_revocation_users_deleted\" after delete on \"user\" referencing old table as gone for each statement execute function \"token_revocation_users_deleted\"();\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 7, 'auth', now());\n\n-- auth 8 organization_revocations: The token revocations by organization, and the trigger that writes them as organizations are deleted.\nalter table \"token_revocation\" alter column \"user_id\" drop not null;\n\nalter table \"token_revocation\" alter column \"rev\" drop not null;\n\nalter table \"token_revocation\" add column \"organization_id\" text;\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 8, 'auth', now());\n\n-- two_factor 1 two_factor: The authenticator secrets and backup codes of two-step sign-in.\ncreate table \"two_factor\" (\n id text primary key,\n \"secret\" text not null,\n \"backup_codes\" text not null,\n \"user_id\" text not null references \"user\" (id) on delete cascade,\n \"verified\" boolean,\n \"failed_verification_count\" integer,\n \"locked_until\" timestamptz\n);\n\ncreate index \"two_factor_secret_idx\" on \"two_factor\" (\"secret\");\n\ncreate index \"two_factor_user_id_idx\" on \"two_factor\" (\"user_id\");\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('two_factor', 1, 'two_factor', now());\n\n-- two_factor 1 two_factor, on the tables of auth: The authenticator secrets and backup codes of two-step sign-in.\nalter table \"user\" add column if not exists \"two_factor_enabled\" boolean;\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('two_factor', 1, 'auth', now());\n\n-- passkeys 1 passkeys: The users' passkeys.\ncreate table \"passkey\" (\n id text primary key,\n \"name\" text,\n \"public_key\" text not null,\n \"user_id\" text not null references \"user\" (id) on delete cascade,\n \"credential_id\" text not null,\n \"counter\" integer not null,\n \"device_type\" text not null,\n \"backed_up\" boolean not null,\n \"transports\" text,\n \"created_at\" timestamptz,\n \"aaguid\" text,\n \"rp_id\" text\n);\n\ncreate index \"passkey_user_id_idx\" on \"passkey\" (\"user_id\");\n\ncreate index \"passkey_credential_id_idx\" on \"passkey\" (\"credential_id\");\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('passkeys', 1, 'passkeys', now());\n\n-- passkeys 2 rp_id_index: The index that finds passkeys by RP ID.\ncreate index \"passkey_rp_id_idx\" on \"passkey\" (\"rp_id\");\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('passkeys', 2, 'passkeys', now());\n\n-- sign_in_policy 1 sign_in_policy: The sign-in policies admins saved.\ncreate table \"sign_in_policy\" (\n id text primary key,\n \"password\" text not null,\n \"email_code\" text not null,\n \"passkey\" text not null,\n \"two_factor\" text not null,\n \"staff_access\" text not null,\n \"platform_sign_in\" text not null,\n \"created_at\" timestamptz not null,\n \"created_by\" text\n);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('sign_in_policy', 1, 'sign_in_policy', now());\n\n-- staff_sign_in 1 staff_sign_in: The log of staff sign-ins as the app's people.\ncreate table \"staff_sign_in\" (\n id text primary key,\n \"user_id\" text not null,\n \"user_email\" text not null,\n \"staff\" text not null,\n \"staff_name\" text,\n \"staff_subject\" text not null,\n \"issuer\" text not null,\n \"reason\" text not null,\n \"session_id\" text not null,\n \"started_at\" timestamptz not null,\n \"expires_at\" timestamptz not null,\n \"ended_at\" timestamptz\n);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('staff_sign_in', 1, 'staff_sign_in', now());\n\n-- staff_sign_in 2 staff_sign_in_indexes: The indexes that find staff sign-ins.\ncreate index \"staff_sign_in_session_id_idx\" on \"staff_sign_in\" (\"session_id\");\n\ncreate index \"staff_sign_in_started_at_idx\" on \"staff_sign_in\" (\"started_at\" desc);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('staff_sign_in', 2, 'staff_sign_in', now());","result":[{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"DO","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"DROP","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]}]}, {"sql":"-- The devices table and its indexes.\ncreate schema if not exists \"notifications\";\ncreate table \"notifications\".\"devices\" (\n \"id\" uuid primary key,\n \"user_id\" text not null references \"user\" (id) on delete cascade,\n \"kind\" text not null check (\"kind\" in ('web', 'apns', 'fcm', 'relay')),\n \"token\" text not null,\n \"p256dh\" text,\n \"auth\" text,\n \"environment\" text check (\"environment\" in ('sandbox', 'production')),\n \"app_id\" text,\n \"user_agent\" text,\n \"session_id\" text,\n \"created_at\" timestamptz not null,\n \"last_seen_at\" timestamptz not null,\n check (\n (\"kind\" = 'web' and \"p256dh\" is not null and \"auth\" is not null and \"environment\" is null and \"app_id\" is null)\n or (\"kind\" = 'apns' and \"p256dh\" is null and \"auth\" is null and \"environment\" is not null and \"app_id\" is not null)\n or (\"kind\" = 'fcm' and \"p256dh\" is null and \"auth\" is null and \"environment\" is null)\n or (\"kind\" = 'relay' and \"p256dh\" is null and \"auth\" is null and \"environment\" is null and \"app_id\" is null)\n )\n);\ncreate unique index on \"notifications\".\"devices\" (\"token\");\ncreate index on \"notifications\".\"devices\" (\"user_id\");\n\n-- The history table and its indexes.\ncreate schema if not exists \"notifications\";\ncreate table \"notifications\".\"history\" (\n \"id\" uuid primary key,\n \"user_id\" text not null references \"user\" (id) on delete cascade,\n \"title\" text not null,\n \"body\" text,\n \"url\" text,\n \"data\" jsonb,\n \"created_at\" timestamptz not null,\n \"read_at\" timestamptz\n);\ncreate index on \"notifications\".\"history\" (\"user_id\", \"created_at\" desc, \"id\" desc);\ncreate index on \"notifications\".\"history\" (\"user_id\", \"created_at\") where \"read_at\" is null;","result":[{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]}]}, {"sql":"select\n exists (select from pg_catalog.pg_trigger where tgrelid = pg_catalog.to_regclass($1) and tgname = $2 and tgenabled in ('O', 'A')) as \"userTrigger\",\n coalesce((select jsonb_agg(jsonb_build_array(highest.key, highest.rev) order by highest.key) from (select \"user_id\" as key, max(\"rev\") as rev from \"token_revocation\"\n where \"user_id\" is not null and \"session_id\" is null group by \"user_id\") as highest), '[]'::jsonb) as users,\n coalesce((select jsonb_agg(jsonb_build_array(highest.key, highest.rev) order by highest.key) from (select \"session_id\" as key, max(\"rev\") as rev from \"token_revocation\"\n where \"user_id\" is not null and \"session_id\" is not null group by \"session_id\") as highest), '[]'::jsonb) as sessions,\n coalesce((select jsonb_agg(jsonb_build_array(gone.key, gone.at) order by gone.key) from (select \"organization_id\" as key,\n extract(epoch from max(coalesce(\"visible_since\", pg_catalog.clock_timestamp())))::float8 as at from \"token_revocation\" where \"organization_id\" is not null group by \"organization_id\") as gone), '[]'::jsonb) as organizations","params":["\"user\"","token_revocation_user_changed"],"result":{"command":"SELECT","rowCount":1,"columns":[["userTrigger",16],["users",3802],["sessions",3802],["organizations",3802]],"rows":[["t","[]","[]","[]"]]}} ], "the devices table with auth's users table > points at the users table, so deleting a user deletes their devices and no one else's": { "the devices table with auth's users table > points at the users table, so deleting a user deletes their devices and no one else's#0": [ {"sql":"select to_regclass($1) is not null as found","params":["\"auth_steps\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}}, {"sql":"select to_regclass($1) is not null as found","params":["\"auth_migrations\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}}, {"sql":"select table_name as \"table\", column_name as \"column\", udt_name as \"type\" from information_schema.columns\n where table_schema = current_schema() order by table_name, ordinal_position","result":{"command":"SELECT","rowCount":0,"columns":[["table",19],["column",19],["type",19]],"rows":[]}}, {"repeated":0}, {"sql":"-- The takes table and its index.\ncreate schema if not exists \"limits\";\n\ncreate table if not exists \"limits\".\"takes\" (\n \"key\" bytea primary key,\n \"count\" integer not null,\n \"expires_at\" timestamptz not null\n);\n\ncreate index if not exists \"takes_expires_at\" on \"limits\".\"takes\" (\"expires_at\");\n\n-- The single-use table and its index.\ncreate table if not exists \"limits\".\"single_use\" (\n \"key\" bytea primary key,\n \"value\" jsonb,\n \"expires_at\" timestamptz not null\n);\n\ncreate index if not exists \"single_use_expires_at\" on \"limits\".\"single_use\" (\"expires_at\");","result":[{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]}]}, {"repeated":1}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["root@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["root","root@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","admin","false","false","2026-08-01T00:00:00.000+00:00","Hhw3ALBkkBwwcpCmliShw1szEdcESEfN"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["Hhw3ALBkkBwwcpCmliShw1szEdcESEfN","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["Hhw3ALBkkBwwcpCmliShw1szEdcESEfN","credential","Hhw3ALBkkBwwcpCmliShw1szEdcESEfN","3d5ee6046255ccff410b04aed8cee828:75fb49746bd0836b5738e984d8b1e680a4271b46ef1987bb0a52adcd0b60c6080c80c9e0ad8a368ed31ae8c29037f680eaab884954951f637f565f916a5ef253","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","AmEBTeYB30OwX7YVMcWPCKikxIfF2h5g"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["AmEBTeYB30OwX7YVMcWPCKikxIfF2h5g","Hhw3ALBkkBwwcpCmliShw1szEdcESEfN","credential","Hhw3ALBkkBwwcpCmliShw1szEdcESEfN",null,null,null,null,null,null,"3d5ee6046255ccff410b04aed8cee828:75fb49746bd0836b5738e984d8b1e680a4271b46ef1987bb0a52adcd0b60c6080c80c9e0ad8a368ed31ae8c29037f680eaab884954951f637f565f916a5ef253","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["Hhw3ALBkkBwwcpCmliShw1szEdcESEfN","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["alice@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["alice","alice@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","user","false","false","2026-08-01T00:00:00.000+00:00","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","credential","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","b8f77cf6cea9b94886737aeeb7a3fe6e:e160e04c39e52f4ee2353153c4b97d7599f1d65553b538477dd857cb784cc946df53d9f0ffaa2c857b71dedc968251984107c9f7b3b27c62cf00d72e5e86626e","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","Pe1LfulbKPM3Cv7oQfLksqg0tAfzoMKC"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["Pe1LfulbKPM3Cv7oQfLksqg0tAfzoMKC","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","credential","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI",null,null,null,null,null,null,"b8f77cf6cea9b94886737aeeb7a3fe6e:e160e04c39e52f4ee2353153c4b97d7599f1d65553b538477dd857cb784cc946df53d9f0ffaa2c857b71dedc968251984107c9f7b3b27c62cf00d72e5e86626e","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["Hhw3ALBkkBwwcpCmliShw1szEdcESEfN","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["bob@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["bob","bob@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","user","false","false","2026-08-01T00:00:00.000+00:00","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","credential","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","3f30b34540165f416d2b361a751fbf4b:c52abf4ffede1eaf5839d308498605268856cefbcfd4040ce67cae7a4c6779500844548c0b72bdd845c93f268cee4ea1181dfa84347a3267553b78a7e3f7990c","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","powLFNH0Gi6824Z5qMR86KGXNuhJXH3d"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["powLFNH0Gi6824Z5qMR86KGXNuhJXH3d","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","credential","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB",null,null,null,null,null,null,"3f30b34540165f416d2b361a751fbf4b:c52abf4ffede1eaf5839d308498605268856cefbcfd4040ce67cae7a4c6779500844548c0b72bdd845c93f268cee4ea1181dfa84347a3267553b78a7e3f7990c","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select to_regclass($1)::oid as oid","params":["\"notifications\".\"devices\""],"result":{"command":"SELECT","rowCount":1,"columns":[["oid",26]],"rows":[["{{oid:1}}"]]}}, {"sql":"select attname as name, attnum as num from pg_attribute where attrelid = $1 and attnum > 0 and not attisdropped","params":["{{oid:1}}"],"result":{"command":"SELECT","rowCount":12,"columns":[["name",19],["num",21]],"rows":[ ["id","1"], ["user_id","2"], ["kind","3"], ["token","4"], ["p256dh","5"], ["auth","6"], ["environment","7"], ["app_id","8"], ["user_agent","9"], ["session_id","10"], ["created_at","11"], ["last_seen_at","12"] ]}}, {"sql":"select c.conname as name, pg_get_constraintdef(c.oid) as def from pg_constraint c\n join pg_attribute a on a.attrelid = c.conrelid and a.attnum = any(c.conkey)\n where c.conrelid = $1 and c.contype = 'c' and a.attname = $2 order by c.conname","params":["{{oid:1}}","kind"],"result":{"command":"SELECT","rowCount":2,"columns":[["name",19],["def",25]],"rows":[ ["devices_check","CHECK ((((kind = 'web'::text) AND (p256dh IS NOT NULL) AND (auth IS NOT NULL) AND (environment IS NULL) AND (app_id IS NULL)) OR ((kind = 'apns'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NOT NULL) AND (app_id IS NOT NULL)) OR ((kind = 'fcm'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NULL)) OR ((kind = 'relay'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NULL) AND (app_id IS NULL))))"], ["devices_kind_check","CHECK ((kind = ANY (ARRAY['web'::text, 'apns'::text, 'fcm'::text, 'relay'::text])))"] ]}}, {"sql":"select exists (select from pg_index where indrelid = $1 and indisunique and indisvalid and indpred is null and indexprs is null and indnatts = 1 and indkey[0] = $2) as found","params":["{{oid:1}}","4"],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["t"]]}}, {"sql":"select exists (select from pg_constraint where conrelid = $1 and contype = 'f' and confdeltype = 'c'\n and conkey = array[$2]::int2[] and confrelid = to_regclass($3)\n and confkey = array[(select attnum from pg_attribute where attrelid = to_regclass($4) and attname = 'id' and not attisdropped)]::int2[]) as found","params":["{{oid:1}}","2","\"user\"","\"user\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["t"]]}}, {"sql":"delete from \"limits\".\"takes\" where \"expires_at\" <= $1","params":["2026-08-01T00:00:00.000+00:00"],"result":{"command":"DELETE","rowCount":0,"columns":[],"rows":[]}}, {"sql":"insert into \"limits\".\"takes\" as t (\"key\", \"count\", \"expires_at\") values ($1, 1, $2)\n on conflict (\"key\") do update set\n \"count\" = case when t.\"expires_at\" <= $3 then 1 else t.\"count\" + 1 end,\n \"expires_at\" = case when t.\"expires_at\" <= $4 then excluded.\"expires_at\" else t.\"expires_at\" end\n returning \"count\", \"expires_at\"","params":[{"hex":"6654a6a87b8bb86a082f93fb47814d79db23d5b0cf3fd9331506f2d5805e181f"},"2026-08-01T00:01:00.000+00:00","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00"],"result":{"command":"INSERT","rowCount":1,"columns":[["count",23],["expires_at",1184]],"rows":[["1","2026-08-01 00:01:00+00"]]}}, {"sql":"select \"primary\".* from (select * from \"sign_in_policy\" order by \"created_at\" desc limit $1) as \"primary\" order by \"created_at\" desc","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["password",25],["email_code",25],["passkey",25],["two_factor",25],["staff_access",25],["platform_sign_in",25],["created_at",1184],["created_by",25]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["alice@example.com"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"account\" where \"account\".\"user_id\" = $1 limit $2) as \"primary\"","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["Pe1LfulbKPM3Cv7oQfLksqg0tAfzoMKC","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","credential","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI",null,null,null,null,null,null,"b8f77cf6cea9b94886737aeeb7a3fe6e:e160e04c39e52f4ee2353153c4b97d7599f1d65553b538477dd857cb784cc946df53d9f0ffaa2c857b71dedc968251984107c9f7b3b27c62cf00d72e5e86626e","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"session\" (\"expires_at\", \"token\", \"created_at\", \"updated_at\", \"ip_address\", \"user_agent\", \"user_id\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8) returning *","params":["2026-08-08T00:00:00.000+00:00","ooOrYE44H16AHivdQl3zyroNuqSQ3T4W","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","127.0.0.1","","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-08 00:00:00+00","ooOrYE44H16AHivdQl3zyroNuqSQ3T4W","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[]}}, {"sql":"insert into \"jwks\" (\"public_key\", \"private_key\", \"created_at\", \"expires_at\", \"alg\", \"crv\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"qUDL3XtBu7kL7o7CsKQqn2b3dlOzsrJP8-3gcjJUflw\"}","\"$ba$205908829$a7863b8de718b3c32926fd38644c40d35e3619887f7849575820907ddc3c209826e8de4891f31eee31be16557b2deeb25fa386d645ca06946b4a1c6321e1e6f9faae0d5408b23b3e9a1e869cd93ed7f6b4a87a9c9957ee071f7d984c849e6efe82f68ca82854f7bdfbbafa9cb2b7046d6513f3daa18f05413c8e70103e0638f8ac1557c6f3b0941cc0701c9c45faab27f88f5694d4b1723a2ec4c91969faf5faecc28ecde152cb95a2\"","2026-08-01T00:00:00.000+00:00","2026-08-31T00:00:00.000+00:00","EdDSA","Ed25519","GRrBZx1A4ACNLHprTabenYjhmMbWaUdO"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["GRrBZx1A4ACNLHprTabenYjhmMbWaUdO","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"qUDL3XtBu7kL7o7CsKQqn2b3dlOzsrJP8-3gcjJUflw\"}","\"$ba$205908829$a7863b8de718b3c32926fd38644c40d35e3619887f7849575820907ddc3c209826e8de4891f31eee31be16557b2deeb25fa386d645ca06946b4a1c6321e1e6f9faae0d5408b23b3e9a1e869cd93ed7f6b4a87a9c9957ee071f7d984c849e6efe82f68ca82854f7bdfbbafa9cb2b7046d6513f3daa18f05413c8e70103e0638f8ac1557c6f3b0941cc0701c9c45faab27f88f5694d4b1723a2ec4c91969faf5faecc28ecde152cb95a2\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"sign_in_policy\" order by \"created_at\" desc limit $1) as \"primary\" order by \"created_at\" desc","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["password",25],["email_code",25],["passkey",25],["two_factor",25],["staff_access",25],["platform_sign_in",25],["created_at",1184],["created_by",25]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"token\" = $1) as \"primary\"","params":["ooOrYE44H16AHivdQl3zyroNuqSQ3T4W"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-08 00:00:00+00","ooOrYE44H16AHivdQl3zyroNuqSQ3T4W","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select coalesce((select \"rev\" from \"token_revision\" where id = $1), 0) as rev","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"SELECT","rowCount":1,"columns":[["rev",20]],"rows":[["0"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-08 00:00:00+00","ooOrYE44H16AHivdQl3zyroNuqSQ3T4W","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["GRrBZx1A4ACNLHprTabenYjhmMbWaUdO","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"qUDL3XtBu7kL7o7CsKQqn2b3dlOzsrJP8-3gcjJUflw\"}","\"$ba$205908829$a7863b8de718b3c32926fd38644c40d35e3619887f7849575820907ddc3c209826e8de4891f31eee31be16557b2deeb25fa386d645ca06946b4a1c6321e1e6f9faae0d5408b23b3e9a1e869cd93ed7f6b4a87a9c9957ee071f7d984c849e6efe82f68ca82854f7bdfbbafa9cb2b7046d6513f3daa18f05413c8e70103e0638f8ac1557c6f3b0941cc0701c9c45faab27f88f5694d4b1723a2ec4c91969faf5faecc28ecde152cb95a2\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["GRrBZx1A4ACNLHprTabenYjhmMbWaUdO","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"qUDL3XtBu7kL7o7CsKQqn2b3dlOzsrJP8-3gcjJUflw\"}","\"$ba$205908829$a7863b8de718b3c32926fd38644c40d35e3619887f7849575820907ddc3c209826e8de4891f31eee31be16557b2deeb25fa386d645ca06946b4a1c6321e1e6f9faae0d5408b23b3e9a1e869cd93ed7f6b4a87a9c9957ee071f7d984c849e6efe82f68ca82854f7bdfbbafa9cb2b7046d6513f3daa18f05413c8e70103e0638f8ac1557c6f3b0941cc0701c9c45faab27f88f5694d4b1723a2ec4c91969faf5faecc28ecde152cb95a2\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-08 00:00:00+00","ooOrYE44H16AHivdQl3zyroNuqSQ3T4W","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"notifications\".\"devices\" as d (\"id\", \"user_id\", \"kind\", \"token\", \"p256dh\", \"auth\", \"environment\", \"app_id\", \"user_agent\", \"session_id\", \"created_at\", \"last_seen_at\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)\n on conflict (\"token\") do update set \"id\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"id\" else excluded.\"id\" end, \"created_at\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"created_at\" else excluded.\"created_at\" end, \"user_id\" = excluded.\"user_id\", \"kind\" = excluded.\"kind\", \"p256dh\" = excluded.\"p256dh\", \"auth\" = excluded.\"auth\", \"environment\" = excluded.\"environment\", \"app_id\" = excluded.\"app_id\", \"user_agent\" = excluded.\"user_agent\", \"session_id\" = excluded.\"session_id\", \"last_seen_at\" = excluded.\"last_seen_at\"\n where \"d\".\"user_id\" = excluded.\"user_id\" or (\"d\".\"kind\" <> 'web' and excluded.\"kind\" <> 'web')\n returning \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\"","params":["989d0bea-c1eb-4842-9a65-7d94d45312a9","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","fcm","alice-1",null,null,null,null,null,"YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[["989d0bea-c1eb-4842-9a65-7d94d45312a9","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","fcm","alice-1",null,null,null,null,null,"YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"]]}}, {"sql":"select \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\" from \"notifications\".\"devices\" where \"user_id\" = $1 order by \"last_seen_at\" desc","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[["989d0bea-c1eb-4842-9a65-7d94d45312a9","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","fcm","alice-1",null,null,null,null,null,"YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-08 00:00:00+00","ooOrYE44H16AHivdQl3zyroNuqSQ3T4W","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"notifications\".\"devices\" as d (\"id\", \"user_id\", \"kind\", \"token\", \"p256dh\", \"auth\", \"environment\", \"app_id\", \"user_agent\", \"session_id\", \"created_at\", \"last_seen_at\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)\n on conflict (\"token\") do update set \"id\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"id\" else excluded.\"id\" end, \"created_at\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"created_at\" else excluded.\"created_at\" end, \"user_id\" = excluded.\"user_id\", \"kind\" = excluded.\"kind\", \"p256dh\" = excluded.\"p256dh\", \"auth\" = excluded.\"auth\", \"environment\" = excluded.\"environment\", \"app_id\" = excluded.\"app_id\", \"user_agent\" = excluded.\"user_agent\", \"session_id\" = excluded.\"session_id\", \"last_seen_at\" = excluded.\"last_seen_at\"\n where \"d\".\"user_id\" = excluded.\"user_id\" or (\"d\".\"kind\" <> 'web' and excluded.\"kind\" <> 'web')\n returning \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\"","params":["22191006-9a43-44ea-a764-7b0b16e7cda0","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","fcm","alice-2",null,null,null,null,null,"YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[["22191006-9a43-44ea-a764-7b0b16e7cda0","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","fcm","alice-2",null,null,null,null,null,"YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"]]}}, {"sql":"select \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\" from \"notifications\".\"devices\" where \"user_id\" = $1 order by \"last_seen_at\" desc","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[ ["989d0bea-c1eb-4842-9a65-7d94d45312a9","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","fcm","alice-1",null,null,null,null,null,"YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"], ["22191006-9a43-44ea-a764-7b0b16e7cda0","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","fcm","alice-2",null,null,null,null,null,"YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"] ]}}, {"sql":"insert into \"limits\".\"takes\" as t (\"key\", \"count\", \"expires_at\") values ($1, 1, $2)\n on conflict (\"key\") do update set\n \"count\" = case when t.\"expires_at\" <= $3 then 1 else t.\"count\" + 1 end,\n \"expires_at\" = case when t.\"expires_at\" <= $4 then excluded.\"expires_at\" else t.\"expires_at\" end\n returning \"count\", \"expires_at\"","params":[{"hex":"6654a6a87b8bb86a082f93fb47814d79db23d5b0cf3fd9331506f2d5805e181f"},"2026-08-01T00:01:00.000+00:00","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00"],"result":{"command":"INSERT","rowCount":1,"columns":[["count",23],["expires_at",1184]],"rows":[["2","2026-08-01 00:01:00+00"]]}}, {"sql":"select \"primary\".* from (select * from \"sign_in_policy\" order by \"created_at\" desc limit $1) as \"primary\" order by \"created_at\" desc","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["password",25],["email_code",25],["passkey",25],["two_factor",25],["staff_access",25],["platform_sign_in",25],["created_at",1184],["created_by",25]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["bob@example.com"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"account\" where \"account\".\"user_id\" = $1 limit $2) as \"primary\"","params":["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["powLFNH0Gi6824Z5qMR86KGXNuhJXH3d","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","credential","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB",null,null,null,null,null,null,"3f30b34540165f416d2b361a751fbf4b:c52abf4ffede1eaf5839d308498605268856cefbcfd4040ce67cae7a4c6779500844548c0b72bdd845c93f268cee4ea1181dfa84347a3267553b78a7e3f7990c","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"session\" (\"expires_at\", \"token\", \"created_at\", \"updated_at\", \"ip_address\", \"user_agent\", \"user_id\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8) returning *","params":["2026-08-08T00:00:00.000+00:00","5mZDKdCX9XYWXWicZ9hv4cpV4AQaPyOB","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","127.0.0.1","","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","WDXB1FxYSljVHaug8KeFwypF4S5gIVKS"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["WDXB1FxYSljVHaug8KeFwypF4S5gIVKS","2026-08-08 00:00:00+00","5mZDKdCX9XYWXWicZ9hv4cpV4AQaPyOB","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"sign_in_policy\" order by \"created_at\" desc limit $1) as \"primary\" order by \"created_at\" desc","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["password",25],["email_code",25],["passkey",25],["two_factor",25],["staff_access",25],["platform_sign_in",25],["created_at",1184],["created_by",25]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"token\" = $1) as \"primary\"","params":["5mZDKdCX9XYWXWicZ9hv4cpV4AQaPyOB"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["WDXB1FxYSljVHaug8KeFwypF4S5gIVKS","2026-08-08 00:00:00+00","5mZDKdCX9XYWXWicZ9hv4cpV4AQaPyOB","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select coalesce((select \"rev\" from \"token_revision\" where id = $1), 0) as rev","params":["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB"],"result":{"command":"SELECT","rowCount":1,"columns":[["rev",20]],"rows":[["0"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["WDXB1FxYSljVHaug8KeFwypF4S5gIVKS"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["WDXB1FxYSljVHaug8KeFwypF4S5gIVKS","2026-08-08 00:00:00+00","5mZDKdCX9XYWXWicZ9hv4cpV4AQaPyOB","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["GRrBZx1A4ACNLHprTabenYjhmMbWaUdO","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"qUDL3XtBu7kL7o7CsKQqn2b3dlOzsrJP8-3gcjJUflw\"}","\"$ba$205908829$a7863b8de718b3c32926fd38644c40d35e3619887f7849575820907ddc3c209826e8de4891f31eee31be16557b2deeb25fa386d645ca06946b4a1c6321e1e6f9faae0d5408b23b3e9a1e869cd93ed7f6b4a87a9c9957ee071f7d984c849e6efe82f68ca82854f7bdfbbafa9cb2b7046d6513f3daa18f05413c8e70103e0638f8ac1557c6f3b0941cc0701c9c45faab27f88f5694d4b1723a2ec4c91969faf5faecc28ecde152cb95a2\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["WDXB1FxYSljVHaug8KeFwypF4S5gIVKS"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["WDXB1FxYSljVHaug8KeFwypF4S5gIVKS","2026-08-08 00:00:00+00","5mZDKdCX9XYWXWicZ9hv4cpV4AQaPyOB","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"notifications\".\"devices\" as d (\"id\", \"user_id\", \"kind\", \"token\", \"p256dh\", \"auth\", \"environment\", \"app_id\", \"user_agent\", \"session_id\", \"created_at\", \"last_seen_at\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)\n on conflict (\"token\") do update set \"id\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"id\" else excluded.\"id\" end, \"created_at\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"created_at\" else excluded.\"created_at\" end, \"user_id\" = excluded.\"user_id\", \"kind\" = excluded.\"kind\", \"p256dh\" = excluded.\"p256dh\", \"auth\" = excluded.\"auth\", \"environment\" = excluded.\"environment\", \"app_id\" = excluded.\"app_id\", \"user_agent\" = excluded.\"user_agent\", \"session_id\" = excluded.\"session_id\", \"last_seen_at\" = excluded.\"last_seen_at\"\n where \"d\".\"user_id\" = excluded.\"user_id\" or (\"d\".\"kind\" <> 'web' and excluded.\"kind\" <> 'web')\n returning \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\"","params":["4275c6f3-49ce-49bc-8f9c-18270dc25151","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","fcm","bob-1",null,null,null,null,null,"WDXB1FxYSljVHaug8KeFwypF4S5gIVKS","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[["4275c6f3-49ce-49bc-8f9c-18270dc25151","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","fcm","bob-1",null,null,null,null,null,"WDXB1FxYSljVHaug8KeFwypF4S5gIVKS","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"]]}}, {"sql":"select \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\" from \"notifications\".\"devices\" where \"user_id\" = $1 order by \"last_seen_at\" desc","params":["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[["4275c6f3-49ce-49bc-8f9c-18270dc25151","wtWX4sAILUpylAM80UnvyUQd2JAjNWfB","fcm","bob-1",null,null,null,null,null,"WDXB1FxYSljVHaug8KeFwypF4S5gIVKS","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["alice@example.com"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"delete from \"notifications\".\"devices\" where \"user_id\" = $1","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"DELETE","rowCount":2,"columns":[],"rows":[]}}, {"sql":"delete from \"notifications\".\"history\" where \"user_id\" = $1","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"DELETE","rowCount":0,"columns":[],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"user_id\" = $1 limit $2) as \"primary\"","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI","2026-08-08 00:00:00+00","ooOrYE44H16AHivdQl3zyroNuqSQ3T4W","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI",null,null]]}}, {"sql":"delete from \"session\" where \"session\".\"user_id\" = $1","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"DELETE","rowCount":1,"columns":[],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"user_id\" = $1 limit $2) as \"primary\"","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","100"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[]}}, {"sql":"delete from \"session\" where \"session\".\"user_id\" = $1","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"DELETE","rowCount":0,"columns":[],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"account\" where \"account\".\"user_id\" = $1 limit $2) as \"primary\"","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["Pe1LfulbKPM3Cv7oQfLksqg0tAfzoMKC","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","credential","To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI",null,null,null,null,null,null,"b8f77cf6cea9b94886737aeeb7a3fe6e:e160e04c39e52f4ee2353153c4b97d7599f1d65553b538477dd857cb784cc946df53d9f0ffaa2c857b71dedc968251984107c9f7b3b27c62cf00d72e5e86626e","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"delete from \"account\" where \"account\".\"user_id\" = $1","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"DELETE","rowCount":1,"columns":[],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1 limit $2) as \"primary\"","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"delete from \"user\" where \"user\".\"id\" = $1","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"DELETE","rowCount":1,"columns":[],"rows":[]}}, {"sql":"delete from \"notifications\".\"devices\" where \"user_id\" = $1","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"DELETE","rowCount":0,"columns":[],"rows":[]}}, {"sql":"delete from \"notifications\".\"history\" where \"user_id\" = $1","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"DELETE","rowCount":0,"columns":[],"rows":[]}}, {"sql":"select token from notifications.devices where user_id = $1 order by token","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"SELECT","rowCount":0,"columns":[["token",25]],"rows":[]}}, {"sql":"select token from notifications.devices where user_id = $1 order by token","params":["wtWX4sAILUpylAM80UnvyUQd2JAjNWfB"],"result":{"command":"SELECT","rowCount":1,"columns":[["token",25]],"rows":[["bob-1"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["YVwhaHCsDPGhlCKc6y6SJhKmhOF6xTyI"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[]}}, {"sql":"select token from notifications.devices where user_id = $1 order by token","params":["To8vS7qOJD6kqdyOE1Idu5Cm1RXnZWmI"],"result":{"command":"SELECT","rowCount":0,"columns":[["token",25]],"rows":[]}} ] }, "the devices table with a renamed users table > points at the users table, so deleting a user deletes their devices and no one else's": { "the devices table with a renamed users table > points at the users table, so deleting a user deletes their devices and no one else's#0": [ {"sql":"select to_regclass($1) is not null as found","params":["\"auth_steps\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}}, {"sql":"select to_regclass($1) is not null as found","params":["\"auth_migrations\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}}, {"sql":"select table_name as \"table\", column_name as \"column\", udt_name as \"type\" from information_schema.columns\n where table_schema = current_schema() order by table_name, ordinal_position","result":{"command":"SELECT","rowCount":0,"columns":[["table",19],["column",19],["type",19]],"rows":[]}}, {"sql":"-- The record of the auth store's steps.\ncreate table if not exists \"auth_steps\" (\n \"module\" text not null,\n \"step\" integer not null,\n \"target\" text not null,\n \"applied_at\" timestamptz,\n primary key (\"module\", \"step\", \"target\")\n);\n\n-- auth 1 core: Better Auth's users, sessions, accounts, verifications and signing keys.\ncreate table if not exists \"people\" (id text primary key);\n\nalter table \"people\"\n add column if not exists \"name\" text not null,\n add column if not exists \"address\" text not null unique,\n add column if not exists \"email_verified\" boolean not null,\n add column if not exists \"image\" text,\n add column if not exists \"created_at\" timestamptz default current_timestamp not null,\n add column if not exists \"updated_at\" timestamptz default current_timestamp not null,\n add column if not exists \"role\" text,\n add column if not exists \"banned\" boolean,\n add column if not exists \"ban_reason\" text,\n add column if not exists \"ban_expires\" timestamptz,\n add column if not exists \"last_role\" text,\n add column if not exists \"email_confirmed_at\" timestamptz;\n\ncreate table \"session\" (\n id text primary key,\n \"expires_at\" timestamptz not null,\n \"token\" text not null unique,\n \"created_at\" timestamptz default current_timestamp not null,\n \"updated_at\" timestamptz not null,\n \"ip_address\" text,\n \"user_agent\" text,\n \"user_id\" text not null references \"people\" (id) on delete cascade,\n \"impersonated_by\" text,\n \"active_role\" text\n);\n\ncreate index \"session_user_id_idx\" on \"session\" (\"user_id\");\n\ncreate table \"account\" (\n id text primary key,\n \"account_id\" text not null,\n \"provider_id\" text not null,\n \"user_id\" text not null references \"people\" (id) on delete cascade,\n \"access_token\" text,\n \"refresh_token\" text,\n \"id_token\" text,\n \"access_token_expires_at\" timestamptz,\n \"refresh_token_expires_at\" timestamptz,\n \"scope\" text,\n \"password\" text,\n \"created_at\" timestamptz default current_timestamp not null,\n \"updated_at\" timestamptz not null\n);\n\ncreate index \"account_user_id_idx\" on \"account\" (\"user_id\");\n\ncreate table \"verification\" (\n id text primary key,\n \"identifier\" text not null,\n \"value\" text not null,\n \"expires_at\" timestamptz not null,\n \"created_at\" timestamptz default current_timestamp not null,\n \"updated_at\" timestamptz default current_timestamp not null\n);\n\ncreate index \"verification_identifier_idx\" on \"verification\" (\"identifier\");\n\ncreate table \"jwks\" (\n id text primary key,\n \"public_key\" text not null,\n \"private_key\" text not null,\n \"created_at\" timestamptz not null,\n \"expires_at\" timestamptz,\n \"alg\" text,\n \"crv\" text\n);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 1, 'auth', now());\n\n-- auth 2 account_keys: One account per provider and account id, and per person where a provider links one.\ndo $check$\ndeclare\n found text;\nbegin\n select string_agg(format('%s %s (accounts %s)', provider, subject, ids), '; ') into found\n from (\n select \"provider_id\" as provider, \"account_id\" as subject, string_agg(id::text, ', ' order by id) as ids\n from \"account\" group by \"provider_id\", \"account_id\" having count(*) > 1 order by 1, 2 limit 20\n ) as twice;\n if found is not null then\n raise exception 'The auth store has more than one account for a provider and account id: %. Keep one of each in a migration of the project''s own written before this one, then apply again.', found;\n end if;\nend\n$check$;\n\ncreate unique index \"account_provider_id_account_id_uidx\" on \"account\" (\"provider_id\", \"account_id\");\n\nalter table \"account\" add column \"single_subject_user_id\" text;\n\ncreate unique index \"account_provider_id_single_subject_user_id_uidx\" on \"account\" (\"provider_id\", \"single_subject_user_id\");\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 2, 'auth', now());\n\n-- auth 3 user_indexes: The indexes that find the active admins and page through the users.\ncreate index if not exists \"people_active_admin_idx\" on \"people\" (id) where \"banned\" is not true and 'admin' = any(regexp_split_to_array(regexp_replace(regexp_replace(coalesce(\"role\", 'user'), '^\\s*\\{(.*)\\}\\s*$', '\\1'), '^\\s*\"?|\"?\\s*$', '', 'g'), '\"?\\s*,\\s*\"?'));\n\ncreate index if not exists \"people_created_at_id_idx\" on \"people\" (\"created_at\", id);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 3, 'auth', now());\n\n-- auth 4 verification_pattern_index: The index that finds app invitations.\ncreate index \"verification_identifier_pattern_idx\" on \"verification\" (\"identifier\" text_pattern_ops);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 4, 'auth', now());\n\n-- auth 5 user_name_search: The indexes that find the users by a part of their name and list them by name.\ncreate extension if not exists pg_trgm;\n\ncreate index if not exists \"people_name_id_idx\" on \"people\" (\"name\", id);\n\ncreate index if not exists \"people_name_trgm_idx\" on \"people\" using gin (\"name\" gin_trgm_ops);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 5, 'auth', now());\n\n-- auth 6 drop_version_record: The drop of the former record of versions, which auth_steps replaced.\ndrop table if exists \"auth_migrations\";\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 6, 'auth', now());\n\n-- auth 7 token_revocations: The token revocations, and the triggers that write them as sessions end and users change.\ncreate table \"token_revocation\" (\n id bigint generated always as identity primary key,\n \"user_id\" text not null,\n \"session_id\" text,\n \"rev\" bigint not null,\n \"revoked_at\" timestamptz not null,\n \"visible_since\" timestamptz\n);\n\ncreate index \"token_revocation_visible_since_idx\" on \"token_revocation\" (\"visible_since\");\n\ncreate table \"token_revision\" (\n id text primary key,\n \"rev\" bigint not null\n);\n\ncreate function \"token_revocation_revoke\"(users text[], sessions text[]) returns void language plpgsql as $$\ndeclare\n attempt integer := 0;\nbegin\n if cardinality(users) = 0 then\n return;\n end if;\n loop\n begin\n with raised as (\n insert into \"token_revision\" (id, \"rev\")\n select raising.id, 1 from (select distinct one.user_id as id from unnest(users) as one (user_id)) as raising order by raising.id\n on conflict (id) do update set \"rev\" = \"token_revision\".\"rev\" + 1\n -- Named with the table, as a column may have the name of one of this function's variables.\n returning \"token_revision\".id, \"token_revision\".\"rev\" as rev\n )\n insert into \"token_revocation\" (\"user_id\", \"session_id\", \"rev\", \"revoked_at\")\n select one.user_id, one.session_id, raised.rev, pg_catalog.clock_timestamp() from unnest(users, sessions) as one (user_id, session_id) join raised on raised.id = one.user_id;\n exit;\n exception when deadlock_detected or serialization_failure then\n attempt := attempt + 1;\n if attempt >= 5 then\n raise;\n end if;\n -- The transaction this one gave way to takes the rows first.\n perform pg_catalog.pg_sleep(0.1 * attempt);\n end;\n end loop;\nend\n$$;\n\ncreate function \"token_revocation_session_ended\"() returns trigger language plpgsql as $$\nbegin\n perform \"token_revocation_revoke\"(revoked.users, revoked.sessions) from (select coalesce(array_agg(one.user_id), '{}') as users, coalesce(array_agg(one.session_id), '{}') as sessions from (select ended.\"user_id\"::text, ended.id::text from ended) as one (user_id, session_id)) as revoked;\n return null;\nend\n$$;\n\ncreate trigger \"token_revocation_session_ended\" after delete on \"session\" referencing old table as ended for each statement execute function \"token_revocation_session_ended\"();\n\ncreate function \"token_revocation_user_changed\"() returns trigger language plpgsql as $$\nbegin\n perform \"token_revocation_revoke\"(revoked.users, revoked.sessions) from (select coalesce(array_agg(one.user_id), '{}') as users, coalesce(array_agg(one.session_id), '{}') as sessions from (select changed.id::text, null::text from was join changed on changed.id = was.id\n where was.\"role\" is distinct from changed.\"role\" or was.\"banned\" is distinct from changed.\"banned\" or was.\"ban_expires\" is distinct from changed.\"ban_expires\") as one (user_id, session_id)) as revoked;\n return null;\nend\n$$;\n\ncreate trigger \"token_revocation_user_changed\" after update on \"people\" referencing old table as was new table as changed for each statement execute function \"token_revocation_user_changed\"();\n\ncreate function \"token_revocation_users_deleted\"() returns trigger language plpgsql as $$\nbegin\n perform \"token_revocation_revoke\"(revoked.users, revoked.sessions) from (select coalesce(array_agg(one.user_id), '{}') as users, coalesce(array_agg(one.session_id), '{}') as sessions from (select gone.id::text, null::text from gone) as one (user_id, session_id)) as revoked;\n return null;\nend\n$$;\n\ncreate trigger \"token_revocation_users_deleted\" after delete on \"people\" referencing old table as gone for each statement execute function \"token_revocation_users_deleted\"();\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 7, 'auth', now());\n\n-- auth 8 organization_revocations: The token revocations by organization, and the trigger that writes them as organizations are deleted.\nalter table \"token_revocation\" alter column \"user_id\" drop not null;\n\nalter table \"token_revocation\" alter column \"rev\" drop not null;\n\nalter table \"token_revocation\" add column \"organization_id\" text;\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('auth', 8, 'auth', now());\n\n-- two_factor 1 two_factor: The authenticator secrets and backup codes of two-step sign-in.\ncreate table \"two_factor\" (\n id text primary key,\n \"secret\" text not null,\n \"backup_codes\" text not null,\n \"user_id\" text not null references \"people\" (id) on delete cascade,\n \"verified\" boolean,\n \"failed_verification_count\" integer,\n \"locked_until\" timestamptz\n);\n\ncreate index \"two_factor_secret_idx\" on \"two_factor\" (\"secret\");\n\ncreate index \"two_factor_user_id_idx\" on \"two_factor\" (\"user_id\");\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('two_factor', 1, 'two_factor', now());\n\n-- two_factor 1 two_factor, on the tables of auth: The authenticator secrets and backup codes of two-step sign-in.\nalter table \"people\" add column if not exists \"two_factor_enabled\" boolean;\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('two_factor', 1, 'auth', now());\n\n-- passkeys 1 passkeys: The users' passkeys.\ncreate table \"passkey\" (\n id text primary key,\n \"name\" text,\n \"public_key\" text not null,\n \"user_id\" text not null references \"people\" (id) on delete cascade,\n \"credential_id\" text not null,\n \"counter\" integer not null,\n \"device_type\" text not null,\n \"backed_up\" boolean not null,\n \"transports\" text,\n \"created_at\" timestamptz,\n \"aaguid\" text,\n \"rp_id\" text\n);\n\ncreate index \"passkey_user_id_idx\" on \"passkey\" (\"user_id\");\n\ncreate index \"passkey_credential_id_idx\" on \"passkey\" (\"credential_id\");\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('passkeys', 1, 'passkeys', now());\n\n-- passkeys 2 rp_id_index: The index that finds passkeys by RP ID.\ncreate index \"passkey_rp_id_idx\" on \"passkey\" (\"rp_id\");\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('passkeys', 2, 'passkeys', now());\n\n-- sign_in_policy 1 sign_in_policy: The sign-in policies admins saved.\ncreate table \"sign_in_policy\" (\n id text primary key,\n \"password\" text not null,\n \"email_code\" text not null,\n \"passkey\" text not null,\n \"two_factor\" text not null,\n \"staff_access\" text not null,\n \"platform_sign_in\" text not null,\n \"created_at\" timestamptz not null,\n \"created_by\" text\n);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('sign_in_policy', 1, 'sign_in_policy', now());\n\n-- staff_sign_in 1 staff_sign_in: The log of staff sign-ins as the app's people.\ncreate table \"staff_sign_in\" (\n id text primary key,\n \"user_id\" text not null,\n \"user_email\" text not null,\n \"staff\" text not null,\n \"staff_name\" text,\n \"staff_subject\" text not null,\n \"issuer\" text not null,\n \"reason\" text not null,\n \"session_id\" text not null,\n \"started_at\" timestamptz not null,\n \"expires_at\" timestamptz not null,\n \"ended_at\" timestamptz\n);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('staff_sign_in', 1, 'staff_sign_in', now());\n\n-- staff_sign_in 2 staff_sign_in_indexes: The indexes that find staff sign-ins.\ncreate index \"staff_sign_in_session_id_idx\" on \"staff_sign_in\" (\"session_id\");\n\ncreate index \"staff_sign_in_started_at_idx\" on \"staff_sign_in\" (\"started_at\" desc);\n\ninsert into \"auth_steps\" (\"module\", \"step\", \"target\", \"applied_at\") values ('staff_sign_in', 2, 'staff_sign_in', now());","result":[{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"DO","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"DROP","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"ALTER","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"INSERT","rowCount":1,"columns":[],"rows":[]}]}, {"sql":"-- The takes table and its index.\ncreate schema if not exists \"limits\";\n\ncreate table if not exists \"limits\".\"takes\" (\n \"key\" bytea primary key,\n \"count\" integer not null,\n \"expires_at\" timestamptz not null\n);\n\ncreate index if not exists \"takes_expires_at\" on \"limits\".\"takes\" (\"expires_at\");\n\n-- The single-use table and its index.\ncreate table if not exists \"limits\".\"single_use\" (\n \"key\" bytea primary key,\n \"value\" jsonb,\n \"expires_at\" timestamptz not null\n);\n\ncreate index if not exists \"single_use_expires_at\" on \"limits\".\"single_use\" (\"expires_at\");","result":[{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]}]}, {"sql":"-- The devices table and its indexes.\ncreate schema if not exists \"notifications\";\ncreate table \"notifications\".\"devices\" (\n \"id\" uuid primary key,\n \"user_id\" text not null references \"people\" (id) on delete cascade,\n \"kind\" text not null check (\"kind\" in ('web', 'apns', 'fcm', 'relay')),\n \"token\" text not null,\n \"p256dh\" text,\n \"auth\" text,\n \"environment\" text check (\"environment\" in ('sandbox', 'production')),\n \"app_id\" text,\n \"user_agent\" text,\n \"session_id\" text,\n \"created_at\" timestamptz not null,\n \"last_seen_at\" timestamptz not null,\n check (\n (\"kind\" = 'web' and \"p256dh\" is not null and \"auth\" is not null and \"environment\" is null and \"app_id\" is null)\n or (\"kind\" = 'apns' and \"p256dh\" is null and \"auth\" is null and \"environment\" is not null and \"app_id\" is not null)\n or (\"kind\" = 'fcm' and \"p256dh\" is null and \"auth\" is null and \"environment\" is null)\n or (\"kind\" = 'relay' and \"p256dh\" is null and \"auth\" is null and \"environment\" is null and \"app_id\" is null)\n )\n);\ncreate unique index on \"notifications\".\"devices\" (\"token\");\ncreate index on \"notifications\".\"devices\" (\"user_id\");\n\n-- The history table and its indexes.\ncreate schema if not exists \"notifications\";\ncreate table \"notifications\".\"history\" (\n \"id\" uuid primary key,\n \"user_id\" text not null references \"people\" (id) on delete cascade,\n \"title\" text not null,\n \"body\" text,\n \"url\" text,\n \"data\" jsonb,\n \"created_at\" timestamptz not null,\n \"read_at\" timestamptz\n);\ncreate index on \"notifications\".\"history\" (\"user_id\", \"created_at\" desc, \"id\" desc);\ncreate index on \"notifications\".\"history\" (\"user_id\", \"created_at\") where \"read_at\" is null;","result":[{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]}]}, {"sql":"select \"primary\".* from (select * from \"people\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"address\" = $1) as \"primary\"","params":["root@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"people\" (\"name\", \"address\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["root","root@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","admin","false","false","2026-08-01T00:00:00.000+00:00","Fevsot7qPNW1mJH2E6M1HsSDYN97dYUs"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["Fevsot7qPNW1mJH2E6M1HsSDYN97dYUs","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["Fevsot7qPNW1mJH2E6M1HsSDYN97dYUs","credential","Fevsot7qPNW1mJH2E6M1HsSDYN97dYUs","671030926fe6f9debf87314701fa2d82:34542ad1e6f98430824fbdf27f6e172855af37e7e76d30d5eb3fe704237d81b5e2aa312498de074c1e0577952d5140131ec118c01ed24f9bc46282dc7dd279a2","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","9jN5QudpOPXXXkDvhSeWJVblvqoCwBmp"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["9jN5QudpOPXXXkDvhSeWJVblvqoCwBmp","Fevsot7qPNW1mJH2E6M1HsSDYN97dYUs","credential","Fevsot7qPNW1mJH2E6M1HsSDYN97dYUs",null,null,null,null,null,null,"671030926fe6f9debf87314701fa2d82:34542ad1e6f98430824fbdf27f6e172855af37e7e76d30d5eb3fe704237d81b5e2aa312498de074c1e0577952d5140131ec118c01ed24f9bc46282dc7dd279a2","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"people\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["Fevsot7qPNW1mJH2E6M1HsSDYN97dYUs","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"address\" = $1) as \"primary\"","params":["alice@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"people\" (\"name\", \"address\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["alice","alice@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","user","false","false","2026-08-01T00:00:00.000+00:00","KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["KScLA95BnrBABB1F1UCjirqziNKb2x6a","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a","credential","KScLA95BnrBABB1F1UCjirqziNKb2x6a","c77c64907894a3aa0c3c3ef9249aaa4e:46e9b920c3acea39a982399dde0f9f840d0263fef45eab6875189ba012c451936f5ba359964a0b2ff9251fd18984bd766e79785d840fa4addad64059d934dfc4","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","iYaAlIIHpZVIfEjCciQiwTSQgLNaheII"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["iYaAlIIHpZVIfEjCciQiwTSQgLNaheII","KScLA95BnrBABB1F1UCjirqziNKb2x6a","credential","KScLA95BnrBABB1F1UCjirqziNKb2x6a",null,null,null,null,null,null,"c77c64907894a3aa0c3c3ef9249aaa4e:46e9b920c3acea39a982399dde0f9f840d0263fef45eab6875189ba012c451936f5ba359964a0b2ff9251fd18984bd766e79785d840fa4addad64059d934dfc4","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"people\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["Fevsot7qPNW1mJH2E6M1HsSDYN97dYUs","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"address\" = $1) as \"primary\"","params":["bob@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"people\" (\"name\", \"address\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["bob","bob@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","user","false","false","2026-08-01T00:00:00.000+00:00","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","credential","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","ea9ca113fcf43f9097648297e0f459ee:f027017305db161d852175aed5cafa3ecac54c9c20d0c59b74d9cdff461d20e86e51e587f72470c0fdda99b5dfa97fa992a0264e20de2900cfb60205bca2ce36","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","uGqfDDItWKQ6T0376qk7nzmiwgm5vmVC"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["uGqfDDItWKQ6T0376qk7nzmiwgm5vmVC","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","credential","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET",null,null,null,null,null,null,"ea9ca113fcf43f9097648297e0f459ee:f027017305db161d852175aed5cafa3ecac54c9c20d0c59b74d9cdff461d20e86e51e587f72470c0fdda99b5dfa97fa992a0264e20de2900cfb60205bca2ce36","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select to_regclass($1)::oid as oid","params":["\"notifications\".\"devices\""],"result":{"command":"SELECT","rowCount":1,"columns":[["oid",26]],"rows":[["{{oid:2}}"]]}}, {"sql":"select attname as name, attnum as num from pg_attribute where attrelid = $1 and attnum > 0 and not attisdropped","params":["{{oid:2}}"],"result":{"command":"SELECT","rowCount":12,"columns":[["name",19],["num",21]],"rows":[ ["id","1"], ["user_id","2"], ["kind","3"], ["token","4"], ["p256dh","5"], ["auth","6"], ["environment","7"], ["app_id","8"], ["user_agent","9"], ["session_id","10"], ["created_at","11"], ["last_seen_at","12"] ]}}, {"sql":"select c.conname as name, pg_get_constraintdef(c.oid) as def from pg_constraint c\n join pg_attribute a on a.attrelid = c.conrelid and a.attnum = any(c.conkey)\n where c.conrelid = $1 and c.contype = 'c' and a.attname = $2 order by c.conname","params":["{{oid:2}}","kind"],"result":{"command":"SELECT","rowCount":2,"columns":[["name",19],["def",25]],"rows":[ ["devices_check","CHECK ((((kind = 'web'::text) AND (p256dh IS NOT NULL) AND (auth IS NOT NULL) AND (environment IS NULL) AND (app_id IS NULL)) OR ((kind = 'apns'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NOT NULL) AND (app_id IS NOT NULL)) OR ((kind = 'fcm'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NULL)) OR ((kind = 'relay'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NULL) AND (app_id IS NULL))))"], ["devices_kind_check","CHECK ((kind = ANY (ARRAY['web'::text, 'apns'::text, 'fcm'::text, 'relay'::text])))"] ]}}, {"sql":"select exists (select from pg_index where indrelid = $1 and indisunique and indisvalid and indpred is null and indexprs is null and indnatts = 1 and indkey[0] = $2) as found","params":["{{oid:2}}","4"],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["t"]]}}, {"sql":"select exists (select from pg_constraint where conrelid = $1 and contype = 'f' and confdeltype = 'c'\n and conkey = array[$2]::int2[] and confrelid = to_regclass($3)\n and confkey = array[(select attnum from pg_attribute where attrelid = to_regclass($4) and attname = 'id' and not attisdropped)]::int2[]) as found","params":["{{oid:2}}","2","\"people\"","\"people\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["t"]]}}, {"sql":"delete from \"limits\".\"takes\" where \"expires_at\" <= $1","params":["2026-08-01T00:00:00.000+00:00"],"result":{"command":"DELETE","rowCount":0,"columns":[],"rows":[]}}, {"sql":"insert into \"limits\".\"takes\" as t (\"key\", \"count\", \"expires_at\") values ($1, 1, $2)\n on conflict (\"key\") do update set\n \"count\" = case when t.\"expires_at\" <= $3 then 1 else t.\"count\" + 1 end,\n \"expires_at\" = case when t.\"expires_at\" <= $4 then excluded.\"expires_at\" else t.\"expires_at\" end\n returning \"count\", \"expires_at\"","params":[{"hex":"6654a6a87b8bb86a082f93fb47814d79db23d5b0cf3fd9331506f2d5805e181f"},"2026-08-01T00:01:00.000+00:00","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00"],"result":{"command":"INSERT","rowCount":1,"columns":[["count",23],["expires_at",1184]],"rows":[["1","2026-08-01 00:01:00+00"]]}}, {"sql":"select \"primary\".* from (select * from \"sign_in_policy\" order by \"created_at\" desc limit $1) as \"primary\" order by \"created_at\" desc","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["password",25],["email_code",25],["passkey",25],["two_factor",25],["staff_access",25],["platform_sign_in",25],["created_at",1184],["created_by",25]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"address\" = $1) as \"primary\"","params":["alice@example.com"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["KScLA95BnrBABB1F1UCjirqziNKb2x6a","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"account\" where \"account\".\"user_id\" = $1 limit $2) as \"primary\"","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a","100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["iYaAlIIHpZVIfEjCciQiwTSQgLNaheII","KScLA95BnrBABB1F1UCjirqziNKb2x6a","credential","KScLA95BnrBABB1F1UCjirqziNKb2x6a",null,null,null,null,null,null,"c77c64907894a3aa0c3c3ef9249aaa4e:46e9b920c3acea39a982399dde0f9f840d0263fef45eab6875189ba012c451936f5ba359964a0b2ff9251fd18984bd766e79785d840fa4addad64059d934dfc4","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"id\" = $1) as \"primary\"","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["KScLA95BnrBABB1F1UCjirqziNKb2x6a","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"session\" (\"expires_at\", \"token\", \"created_at\", \"updated_at\", \"ip_address\", \"user_agent\", \"user_id\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8) returning *","params":["2026-08-08T00:00:00.000+00:00","Ozm5MO7cKkox41NCOnJRSccjoxSeEY1C","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","127.0.0.1","","KScLA95BnrBABB1F1UCjirqziNKb2x6a","V7Do6JyHxxklnW838kJMDRxT3FogOI2g"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-08 00:00:00+00","Ozm5MO7cKkox41NCOnJRSccjoxSeEY1C","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","KScLA95BnrBABB1F1UCjirqziNKb2x6a",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[]}}, {"sql":"insert into \"jwks\" (\"public_key\", \"private_key\", \"created_at\", \"expires_at\", \"alg\", \"crv\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"xq0F31Hq8cdxKjQpX7DuNfZ-eHAxeZMuq7iXVyE2YHc\"}","\"$ba$205908829$b7f0eeb81e537312b9a39271945656a2fe80d0d6c5fdce1ad8d0f4980dbca9c5d9a75ce404322d7e10418be7f375f24f976cbf21eb5c8eb7fab85d81294443c56dbd6129eb57de2d7ae933050548e15ae0d82551f5f042d0423796e3a152307350f3ce256911badfd644f216c229e6b18f1726e86ee3e4e66a5c9acce6d138bca19af39be34de874d65b105195c2f43ab6d457c57fbfefd7c22cd016dcacb3feeb242f7686e7635001\"","2026-08-01T00:00:00.000+00:00","2026-08-31T00:00:00.000+00:00","EdDSA","Ed25519","yBv6QTJ90fYSan06wxHnVY3KRlmuvxiW"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["yBv6QTJ90fYSan06wxHnVY3KRlmuvxiW","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"xq0F31Hq8cdxKjQpX7DuNfZ-eHAxeZMuq7iXVyE2YHc\"}","\"$ba$205908829$b7f0eeb81e537312b9a39271945656a2fe80d0d6c5fdce1ad8d0f4980dbca9c5d9a75ce404322d7e10418be7f375f24f976cbf21eb5c8eb7fab85d81294443c56dbd6129eb57de2d7ae933050548e15ae0d82551f5f042d0423796e3a152307350f3ce256911badfd644f216c229e6b18f1726e86ee3e4e66a5c9acce6d138bca19af39be34de874d65b105195c2f43ab6d457c57fbfefd7c22cd016dcacb3feeb242f7686e7635001\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"sign_in_policy\" order by \"created_at\" desc limit $1) as \"primary\" order by \"created_at\" desc","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["password",25],["email_code",25],["passkey",25],["two_factor",25],["staff_access",25],["platform_sign_in",25],["created_at",1184],["created_by",25]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"token\" = $1) as \"primary\"","params":["Ozm5MO7cKkox41NCOnJRSccjoxSeEY1C"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-08 00:00:00+00","Ozm5MO7cKkox41NCOnJRSccjoxSeEY1C","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","KScLA95BnrBABB1F1UCjirqziNKb2x6a",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"id\" = $1) as \"primary\"","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["KScLA95BnrBABB1F1UCjirqziNKb2x6a","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select coalesce((select \"rev\" from \"token_revision\" where id = $1), 0) as rev","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"SELECT","rowCount":1,"columns":[["rev",20]],"rows":[["0"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["V7Do6JyHxxklnW838kJMDRxT3FogOI2g"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-08 00:00:00+00","Ozm5MO7cKkox41NCOnJRSccjoxSeEY1C","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","KScLA95BnrBABB1F1UCjirqziNKb2x6a",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"id\" = $1) as \"primary\"","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["KScLA95BnrBABB1F1UCjirqziNKb2x6a","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["yBv6QTJ90fYSan06wxHnVY3KRlmuvxiW","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"xq0F31Hq8cdxKjQpX7DuNfZ-eHAxeZMuq7iXVyE2YHc\"}","\"$ba$205908829$b7f0eeb81e537312b9a39271945656a2fe80d0d6c5fdce1ad8d0f4980dbca9c5d9a75ce404322d7e10418be7f375f24f976cbf21eb5c8eb7fab85d81294443c56dbd6129eb57de2d7ae933050548e15ae0d82551f5f042d0423796e3a152307350f3ce256911badfd644f216c229e6b18f1726e86ee3e4e66a5c9acce6d138bca19af39be34de874d65b105195c2f43ab6d457c57fbfefd7c22cd016dcacb3feeb242f7686e7635001\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["yBv6QTJ90fYSan06wxHnVY3KRlmuvxiW","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"xq0F31Hq8cdxKjQpX7DuNfZ-eHAxeZMuq7iXVyE2YHc\"}","\"$ba$205908829$b7f0eeb81e537312b9a39271945656a2fe80d0d6c5fdce1ad8d0f4980dbca9c5d9a75ce404322d7e10418be7f375f24f976cbf21eb5c8eb7fab85d81294443c56dbd6129eb57de2d7ae933050548e15ae0d82551f5f042d0423796e3a152307350f3ce256911badfd644f216c229e6b18f1726e86ee3e4e66a5c9acce6d138bca19af39be34de874d65b105195c2f43ab6d457c57fbfefd7c22cd016dcacb3feeb242f7686e7635001\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["V7Do6JyHxxklnW838kJMDRxT3FogOI2g"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-08 00:00:00+00","Ozm5MO7cKkox41NCOnJRSccjoxSeEY1C","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","KScLA95BnrBABB1F1UCjirqziNKb2x6a",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"id\" = $1) as \"primary\"","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["KScLA95BnrBABB1F1UCjirqziNKb2x6a","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"notifications\".\"devices\" as d (\"id\", \"user_id\", \"kind\", \"token\", \"p256dh\", \"auth\", \"environment\", \"app_id\", \"user_agent\", \"session_id\", \"created_at\", \"last_seen_at\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)\n on conflict (\"token\") do update set \"id\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"id\" else excluded.\"id\" end, \"created_at\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"created_at\" else excluded.\"created_at\" end, \"user_id\" = excluded.\"user_id\", \"kind\" = excluded.\"kind\", \"p256dh\" = excluded.\"p256dh\", \"auth\" = excluded.\"auth\", \"environment\" = excluded.\"environment\", \"app_id\" = excluded.\"app_id\", \"user_agent\" = excluded.\"user_agent\", \"session_id\" = excluded.\"session_id\", \"last_seen_at\" = excluded.\"last_seen_at\"\n where \"d\".\"user_id\" = excluded.\"user_id\" or (\"d\".\"kind\" <> 'web' and excluded.\"kind\" <> 'web')\n returning \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\"","params":["e08b840a-dd30-46ef-b491-c6f6b6f9870f","KScLA95BnrBABB1F1UCjirqziNKb2x6a","fcm","alice-1",null,null,null,null,null,"V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[["e08b840a-dd30-46ef-b491-c6f6b6f9870f","KScLA95BnrBABB1F1UCjirqziNKb2x6a","fcm","alice-1",null,null,null,null,null,"V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"]]}}, {"sql":"select \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\" from \"notifications\".\"devices\" where \"user_id\" = $1 order by \"last_seen_at\" desc","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[["e08b840a-dd30-46ef-b491-c6f6b6f9870f","KScLA95BnrBABB1F1UCjirqziNKb2x6a","fcm","alice-1",null,null,null,null,null,"V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["V7Do6JyHxxklnW838kJMDRxT3FogOI2g"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-08 00:00:00+00","Ozm5MO7cKkox41NCOnJRSccjoxSeEY1C","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","KScLA95BnrBABB1F1UCjirqziNKb2x6a",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"id\" = $1) as \"primary\"","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["KScLA95BnrBABB1F1UCjirqziNKb2x6a","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"notifications\".\"devices\" as d (\"id\", \"user_id\", \"kind\", \"token\", \"p256dh\", \"auth\", \"environment\", \"app_id\", \"user_agent\", \"session_id\", \"created_at\", \"last_seen_at\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)\n on conflict (\"token\") do update set \"id\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"id\" else excluded.\"id\" end, \"created_at\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"created_at\" else excluded.\"created_at\" end, \"user_id\" = excluded.\"user_id\", \"kind\" = excluded.\"kind\", \"p256dh\" = excluded.\"p256dh\", \"auth\" = excluded.\"auth\", \"environment\" = excluded.\"environment\", \"app_id\" = excluded.\"app_id\", \"user_agent\" = excluded.\"user_agent\", \"session_id\" = excluded.\"session_id\", \"last_seen_at\" = excluded.\"last_seen_at\"\n where \"d\".\"user_id\" = excluded.\"user_id\" or (\"d\".\"kind\" <> 'web' and excluded.\"kind\" <> 'web')\n returning \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\"","params":["86d98857-26a0-4904-a789-7eb463de9f97","KScLA95BnrBABB1F1UCjirqziNKb2x6a","fcm","alice-2",null,null,null,null,null,"V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[["86d98857-26a0-4904-a789-7eb463de9f97","KScLA95BnrBABB1F1UCjirqziNKb2x6a","fcm","alice-2",null,null,null,null,null,"V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"]]}}, {"sql":"select \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\" from \"notifications\".\"devices\" where \"user_id\" = $1 order by \"last_seen_at\" desc","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"SELECT","rowCount":2,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[ ["e08b840a-dd30-46ef-b491-c6f6b6f9870f","KScLA95BnrBABB1F1UCjirqziNKb2x6a","fcm","alice-1",null,null,null,null,null,"V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"], ["86d98857-26a0-4904-a789-7eb463de9f97","KScLA95BnrBABB1F1UCjirqziNKb2x6a","fcm","alice-2",null,null,null,null,null,"V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"] ]}}, {"sql":"insert into \"limits\".\"takes\" as t (\"key\", \"count\", \"expires_at\") values ($1, 1, $2)\n on conflict (\"key\") do update set\n \"count\" = case when t.\"expires_at\" <= $3 then 1 else t.\"count\" + 1 end,\n \"expires_at\" = case when t.\"expires_at\" <= $4 then excluded.\"expires_at\" else t.\"expires_at\" end\n returning \"count\", \"expires_at\"","params":[{"hex":"6654a6a87b8bb86a082f93fb47814d79db23d5b0cf3fd9331506f2d5805e181f"},"2026-08-01T00:01:00.000+00:00","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00"],"result":{"command":"INSERT","rowCount":1,"columns":[["count",23],["expires_at",1184]],"rows":[["2","2026-08-01 00:01:00+00"]]}}, {"sql":"select \"primary\".* from (select * from \"sign_in_policy\" order by \"created_at\" desc limit $1) as \"primary\" order by \"created_at\" desc","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["password",25],["email_code",25],["passkey",25],["two_factor",25],["staff_access",25],["platform_sign_in",25],["created_at",1184],["created_by",25]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"address\" = $1) as \"primary\"","params":["bob@example.com"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"account\" where \"account\".\"user_id\" = $1 limit $2) as \"primary\"","params":["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["uGqfDDItWKQ6T0376qk7nzmiwgm5vmVC","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","credential","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET",null,null,null,null,null,null,"ea9ca113fcf43f9097648297e0f459ee:f027017305db161d852175aed5cafa3ecac54c9c20d0c59b74d9cdff461d20e86e51e587f72470c0fdda99b5dfa97fa992a0264e20de2900cfb60205bca2ce36","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"id\" = $1) as \"primary\"","params":["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"session\" (\"expires_at\", \"token\", \"created_at\", \"updated_at\", \"ip_address\", \"user_agent\", \"user_id\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8) returning *","params":["2026-08-08T00:00:00.000+00:00","JcnvEW9LsfGrUozY0W7UHknJFvwEgFKE","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","127.0.0.1","","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","EX6UFAAfvY1qWBFkS6wtWip0rdlLw7xs"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["EX6UFAAfvY1qWBFkS6wtWip0rdlLw7xs","2026-08-08 00:00:00+00","JcnvEW9LsfGrUozY0W7UHknJFvwEgFKE","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"sign_in_policy\" order by \"created_at\" desc limit $1) as \"primary\" order by \"created_at\" desc","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["password",25],["email_code",25],["passkey",25],["two_factor",25],["staff_access",25],["platform_sign_in",25],["created_at",1184],["created_by",25]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"token\" = $1) as \"primary\"","params":["JcnvEW9LsfGrUozY0W7UHknJFvwEgFKE"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["EX6UFAAfvY1qWBFkS6wtWip0rdlLw7xs","2026-08-08 00:00:00+00","JcnvEW9LsfGrUozY0W7UHknJFvwEgFKE","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"id\" = $1) as \"primary\"","params":["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select coalesce((select \"rev\" from \"token_revision\" where id = $1), 0) as rev","params":["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET"],"result":{"command":"SELECT","rowCount":1,"columns":[["rev",20]],"rows":[["0"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["EX6UFAAfvY1qWBFkS6wtWip0rdlLw7xs"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["EX6UFAAfvY1qWBFkS6wtWip0rdlLw7xs","2026-08-08 00:00:00+00","JcnvEW9LsfGrUozY0W7UHknJFvwEgFKE","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"id\" = $1) as \"primary\"","params":["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["yBv6QTJ90fYSan06wxHnVY3KRlmuvxiW","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"xq0F31Hq8cdxKjQpX7DuNfZ-eHAxeZMuq7iXVyE2YHc\"}","\"$ba$205908829$b7f0eeb81e537312b9a39271945656a2fe80d0d6c5fdce1ad8d0f4980dbca9c5d9a75ce404322d7e10418be7f375f24f976cbf21eb5c8eb7fab85d81294443c56dbd6129eb57de2d7ae933050548e15ae0d82551f5f042d0423796e3a152307350f3ce256911badfd644f216c229e6b18f1726e86ee3e4e66a5c9acce6d138bca19af39be34de874d65b105195c2f43ab6d457c57fbfefd7c22cd016dcacb3feeb242f7686e7635001\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["EX6UFAAfvY1qWBFkS6wtWip0rdlLw7xs"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["EX6UFAAfvY1qWBFkS6wtWip0rdlLw7xs","2026-08-08 00:00:00+00","JcnvEW9LsfGrUozY0W7UHknJFvwEgFKE","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"id\" = $1) as \"primary\"","params":["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"notifications\".\"devices\" as d (\"id\", \"user_id\", \"kind\", \"token\", \"p256dh\", \"auth\", \"environment\", \"app_id\", \"user_agent\", \"session_id\", \"created_at\", \"last_seen_at\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)\n on conflict (\"token\") do update set \"id\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"id\" else excluded.\"id\" end, \"created_at\" = case when \"d\".\"user_id\" = excluded.\"user_id\" then \"d\".\"created_at\" else excluded.\"created_at\" end, \"user_id\" = excluded.\"user_id\", \"kind\" = excluded.\"kind\", \"p256dh\" = excluded.\"p256dh\", \"auth\" = excluded.\"auth\", \"environment\" = excluded.\"environment\", \"app_id\" = excluded.\"app_id\", \"user_agent\" = excluded.\"user_agent\", \"session_id\" = excluded.\"session_id\", \"last_seen_at\" = excluded.\"last_seen_at\"\n where \"d\".\"user_id\" = excluded.\"user_id\" or (\"d\".\"kind\" <> 'web' and excluded.\"kind\" <> 'web')\n returning \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\"","params":["c5295f58-ced3-4992-9bbe-f7bb98286594","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","fcm","bob-1",null,null,null,null,null,"EX6UFAAfvY1qWBFkS6wtWip0rdlLw7xs","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[["c5295f58-ced3-4992-9bbe-f7bb98286594","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","fcm","bob-1",null,null,null,null,null,"EX6UFAAfvY1qWBFkS6wtWip0rdlLw7xs","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"]]}}, {"sql":"select \"id\" as \"id\", \"user_id\" as \"user_id\", \"kind\" as \"kind\", \"token\" as \"token\", \"p256dh\" as \"p256dh\", \"auth\" as \"auth\", \"environment\" as \"environment\", \"app_id\" as \"app_id\", \"user_agent\" as \"user_agent\", \"session_id\" as \"session_id\", \"created_at\" as \"created_at\", \"last_seen_at\" as \"last_seen_at\" from \"notifications\".\"devices\" where \"user_id\" = $1 order by \"last_seen_at\" desc","params":["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",2950],["user_id",25],["kind",25],["token",25],["p256dh",25],["auth",25],["environment",25],["app_id",25],["user_agent",25],["session_id",25],["created_at",1184],["last_seen_at",1184]],"rows":[["c5295f58-ced3-4992-9bbe-f7bb98286594","PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET","fcm","bob-1",null,null,null,null,null,"EX6UFAAfvY1qWBFkS6wtWip0rdlLw7xs","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00"]]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"address\" = $1) as \"primary\"","params":["alice@example.com"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["KScLA95BnrBABB1F1UCjirqziNKb2x6a","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"delete from \"notifications\".\"devices\" where \"user_id\" = $1","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"DELETE","rowCount":2,"columns":[],"rows":[]}}, {"sql":"delete from \"notifications\".\"history\" where \"user_id\" = $1","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"DELETE","rowCount":0,"columns":[],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"user_id\" = $1 limit $2) as \"primary\"","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a","100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["V7Do6JyHxxklnW838kJMDRxT3FogOI2g","2026-08-08 00:00:00+00","Ozm5MO7cKkox41NCOnJRSccjoxSeEY1C","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","KScLA95BnrBABB1F1UCjirqziNKb2x6a",null,null]]}}, {"sql":"delete from \"session\" where \"session\".\"user_id\" = $1","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"DELETE","rowCount":1,"columns":[],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"user_id\" = $1 limit $2) as \"primary\"","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a","100"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[]}}, {"sql":"delete from \"session\" where \"session\".\"user_id\" = $1","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"DELETE","rowCount":0,"columns":[],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"account\" where \"account\".\"user_id\" = $1 limit $2) as \"primary\"","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a","100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["iYaAlIIHpZVIfEjCciQiwTSQgLNaheII","KScLA95BnrBABB1F1UCjirqziNKb2x6a","credential","KScLA95BnrBABB1F1UCjirqziNKb2x6a",null,null,null,null,null,null,"c77c64907894a3aa0c3c3ef9249aaa4e:46e9b920c3acea39a982399dde0f9f840d0263fef45eab6875189ba012c451936f5ba359964a0b2ff9251fd18984bd766e79785d840fa4addad64059d934dfc4","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"delete from \"account\" where \"account\".\"user_id\" = $1","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"DELETE","rowCount":1,"columns":[],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"people\" where \"people\".\"id\" = $1 limit $2) as \"primary\"","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a","1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["address",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["KScLA95BnrBABB1F1UCjirqziNKb2x6a","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"delete from \"people\" where \"people\".\"id\" = $1","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"DELETE","rowCount":1,"columns":[],"rows":[]}}, {"sql":"delete from \"notifications\".\"devices\" where \"user_id\" = $1","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"DELETE","rowCount":0,"columns":[],"rows":[]}}, {"sql":"delete from \"notifications\".\"history\" where \"user_id\" = $1","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"DELETE","rowCount":0,"columns":[],"rows":[]}}, {"sql":"select token from notifications.devices where user_id = $1 order by token","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"SELECT","rowCount":0,"columns":[["token",25]],"rows":[]}}, {"sql":"select token from notifications.devices where user_id = $1 order by token","params":["PxnE81EdEP3ipQuN5eOAFwv9LpGqsLET"],"result":{"command":"SELECT","rowCount":1,"columns":[["token",25]],"rows":[["bob-1"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["V7Do6JyHxxklnW838kJMDRxT3FogOI2g"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[]}}, {"sql":"select token from notifications.devices where user_id = $1 order by token","params":["KScLA95BnrBABB1F1UCjirqziNKb2x6a"],"result":{"command":"SELECT","rowCount":0,"columns":[["token",25]],"rows":[]}} ] }, "the devices endpoints with auth > are refused by the baseline while the devices table's user column does not go with the user's id": { "the devices endpoints with auth > are refused by the baseline while the devices table's user column does not go with the user's id#0": [ {"sql":"select to_regclass($1) is not null as found","params":["\"auth_steps\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}}, {"sql":"select to_regclass($1) is not null as found","params":["\"auth_migrations\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}}, {"sql":"select table_name as \"table\", column_name as \"column\", udt_name as \"type\" from information_schema.columns\n where table_schema = current_schema() order by table_name, ordinal_position","result":{"command":"SELECT","rowCount":0,"columns":[["table",19],["column",19],["type",19]],"rows":[]}}, {"repeated":0}, {"sql":"-- The takes table and its index.\ncreate schema if not exists \"limits\";\n\ncreate table if not exists \"limits\".\"takes\" (\n \"key\" bytea primary key,\n \"count\" integer not null,\n \"expires_at\" timestamptz not null\n);\n\ncreate index if not exists \"takes_expires_at\" on \"limits\".\"takes\" (\"expires_at\");\n\n-- The single-use table and its index.\ncreate table if not exists \"limits\".\"single_use\" (\n \"key\" bytea primary key,\n \"value\" jsonb,\n \"expires_at\" timestamptz not null\n);\n\ncreate index if not exists \"single_use_expires_at\" on \"limits\".\"single_use\" (\"expires_at\");","result":[{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]}]}, {"repeated":1}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["root@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["root","root@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","admin","false","false","2026-08-01T00:00:00.000+00:00","511xHpuUwdrjbpnOgxbncgiBgIMVwKGx"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["511xHpuUwdrjbpnOgxbncgiBgIMVwKGx","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["511xHpuUwdrjbpnOgxbncgiBgIMVwKGx","credential","511xHpuUwdrjbpnOgxbncgiBgIMVwKGx","d71b3d545256ea66dd19d2b173a3ca46:c852ce5880c95e2efbfa38d1b13fd9e06515b617421acaf4369caa56e3a94909589aaccc8c719946e67535b6d757bbea09a2695d11d16045ae224b87f2233991","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","EHLxfYZLTvGG35aADKRlEJokUKMIiv7O"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["EHLxfYZLTvGG35aADKRlEJokUKMIiv7O","511xHpuUwdrjbpnOgxbncgiBgIMVwKGx","credential","511xHpuUwdrjbpnOgxbncgiBgIMVwKGx",null,null,null,null,null,null,"d71b3d545256ea66dd19d2b173a3ca46:c852ce5880c95e2efbfa38d1b13fd9e06515b617421acaf4369caa56e3a94909589aaccc8c719946e67535b6d757bbea09a2695d11d16045ae224b87f2233991","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["511xHpuUwdrjbpnOgxbncgiBgIMVwKGx","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["alice@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["alice","alice@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","user","false","false","2026-08-01T00:00:00.000+00:00","J4cSHI8bwfYymraegbwM5XCZstKvuvTw"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["J4cSHI8bwfYymraegbwM5XCZstKvuvTw","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["J4cSHI8bwfYymraegbwM5XCZstKvuvTw","credential","J4cSHI8bwfYymraegbwM5XCZstKvuvTw","0cfda0a0e30dc6a3fae09175293f85ed:14c327d41b7e50cc1388e4480ba92272ef7c705a854ae750fdab723e0f1f6b3d5317056e55a0c201284cf9378b532bf56715ebea545de3c7fbdd0c010f061ab9","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","YzNNZQMSkU3efSFgAET8lz8ICTl2O4IL"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["YzNNZQMSkU3efSFgAET8lz8ICTl2O4IL","J4cSHI8bwfYymraegbwM5XCZstKvuvTw","credential","J4cSHI8bwfYymraegbwM5XCZstKvuvTw",null,null,null,null,null,null,"0cfda0a0e30dc6a3fae09175293f85ed:14c327d41b7e50cc1388e4480ba92272ef7c705a854ae750fdab723e0f1f6b3d5317056e55a0c201284cf9378b532bf56715ebea545de3c7fbdd0c010f061ab9","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["511xHpuUwdrjbpnOgxbncgiBgIMVwKGx","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["bob@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["bob","bob@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","user","false","false","2026-08-01T00:00:00.000+00:00","g712g3WMDHPY4Pv5N3xTtb1udHBXZ4RF"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["g712g3WMDHPY4Pv5N3xTtb1udHBXZ4RF","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["g712g3WMDHPY4Pv5N3xTtb1udHBXZ4RF","credential","g712g3WMDHPY4Pv5N3xTtb1udHBXZ4RF","14ba3cb0ab640c553f489fa9f2e53317:6d89b59903322ce11098988feaecd6f0792267c729354f883c0fc583ca3798919a562488b653981a380dfe97d3e853a69164c220904b10f322d6f86797a973ba","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","JwA6nmPefD1jFibl3oXrXlM7jBU1KLxG"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["JwA6nmPefD1jFibl3oXrXlM7jBU1KLxG","g712g3WMDHPY4Pv5N3xTtb1udHBXZ4RF","credential","g712g3WMDHPY4Pv5N3xTtb1udHBXZ4RF",null,null,null,null,null,null,"14ba3cb0ab640c553f489fa9f2e53317:6d89b59903322ce11098988feaecd6f0792267c729354f883c0fc583ca3798919a562488b653981a380dfe97d3e853a69164c220904b10f322d6f86797a973ba","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"alter table notifications.devices drop constraint devices_user_id_fkey","result":{"command":"ALTER","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select to_regclass($1)::oid as oid","params":["\"notifications\".\"devices\""],"result":{"command":"SELECT","rowCount":1,"columns":[["oid",26]],"rows":[["{{oid:3}}"]]}}, {"sql":"select attname as name, attnum as num from pg_attribute where attrelid = $1 and attnum > 0 and not attisdropped","params":["{{oid:3}}"],"result":{"command":"SELECT","rowCount":12,"columns":[["name",19],["num",21]],"rows":[ ["id","1"], ["user_id","2"], ["kind","3"], ["token","4"], ["p256dh","5"], ["auth","6"], ["environment","7"], ["app_id","8"], ["user_agent","9"], ["session_id","10"], ["created_at","11"], ["last_seen_at","12"] ]}}, {"sql":"select c.conname as name, pg_get_constraintdef(c.oid) as def from pg_constraint c\n join pg_attribute a on a.attrelid = c.conrelid and a.attnum = any(c.conkey)\n where c.conrelid = $1 and c.contype = 'c' and a.attname = $2 order by c.conname","params":["{{oid:3}}","kind"],"result":{"command":"SELECT","rowCount":2,"columns":[["name",19],["def",25]],"rows":[ ["devices_check","CHECK ((((kind = 'web'::text) AND (p256dh IS NOT NULL) AND (auth IS NOT NULL) AND (environment IS NULL) AND (app_id IS NULL)) OR ((kind = 'apns'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NOT NULL) AND (app_id IS NOT NULL)) OR ((kind = 'fcm'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NULL)) OR ((kind = 'relay'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NULL) AND (app_id IS NULL))))"], ["devices_kind_check","CHECK ((kind = ANY (ARRAY['web'::text, 'apns'::text, 'fcm'::text, 'relay'::text])))"] ]}}, {"sql":"select exists (select from pg_index where indrelid = $1 and indisunique and indisvalid and indpred is null and indexprs is null and indnatts = 1 and indkey[0] = $2) as found","params":["{{oid:3}}","4"],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["t"]]}}, {"sql":"select exists (select from pg_constraint where conrelid = $1 and contype = 'f' and confdeltype = 'c'\n and conkey = array[$2]::int2[] and confrelid = to_regclass($3)\n and confkey = array[(select attnum from pg_attribute where attrelid = to_regclass($4) and attname = 'id' and not attisdropped)]::int2[]) as found","params":["{{oid:3}}","2","\"user\"","\"user\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}}, {"sql":"alter table notifications.devices add constraint devices_user_email_fkey foreign key (user_id) references \"user\" (email) on delete cascade","result":{"command":"ALTER","rowCount":null,"columns":[],"rows":[]}}, {"sql":"select to_regclass($1)::oid as oid","params":["\"notifications\".\"devices\""],"result":{"command":"SELECT","rowCount":1,"columns":[["oid",26]],"rows":[["{{oid:3}}"]]}}, {"sql":"select attname as name, attnum as num from pg_attribute where attrelid = $1 and attnum > 0 and not attisdropped","params":["{{oid:3}}"],"result":{"command":"SELECT","rowCount":12,"columns":[["name",19],["num",21]],"rows":[ ["id","1"], ["user_id","2"], ["kind","3"], ["token","4"], ["p256dh","5"], ["auth","6"], ["environment","7"], ["app_id","8"], ["user_agent","9"], ["session_id","10"], ["created_at","11"], ["last_seen_at","12"] ]}}, {"sql":"select c.conname as name, pg_get_constraintdef(c.oid) as def from pg_constraint c\n join pg_attribute a on a.attrelid = c.conrelid and a.attnum = any(c.conkey)\n where c.conrelid = $1 and c.contype = 'c' and a.attname = $2 order by c.conname","params":["{{oid:3}}","kind"],"result":{"command":"SELECT","rowCount":2,"columns":[["name",19],["def",25]],"rows":[ ["devices_check","CHECK ((((kind = 'web'::text) AND (p256dh IS NOT NULL) AND (auth IS NOT NULL) AND (environment IS NULL) AND (app_id IS NULL)) OR ((kind = 'apns'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NOT NULL) AND (app_id IS NOT NULL)) OR ((kind = 'fcm'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NULL)) OR ((kind = 'relay'::text) AND (p256dh IS NULL) AND (auth IS NULL) AND (environment IS NULL) AND (app_id IS NULL))))"], ["devices_kind_check","CHECK ((kind = ANY (ARRAY['web'::text, 'apns'::text, 'fcm'::text, 'relay'::text])))"] ]}}, {"sql":"select exists (select from pg_index where indrelid = $1 and indisunique and indisvalid and indpred is null and indexprs is null and indnatts = 1 and indkey[0] = $2) as found","params":["{{oid:3}}","4"],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["t"]]}}, {"sql":"select exists (select from pg_constraint where conrelid = $1 and contype = 'f' and confdeltype = 'c'\n and conkey = array[$2]::int2[] and confrelid = to_regclass($3)\n and confkey = array[(select attnum from pg_attribute where attrelid = to_regclass($4) and attname = 'id' and not attisdropped)]::int2[]) as found","params":["{{oid:3}}","2","\"user\"","\"user\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}} ] }, "the devices endpoints with auth > are an unknown route without notifications()": { "the devices endpoints with auth > are an unknown route without notifications()#0": [ {"sql":"select to_regclass($1) is not null as found","params":["\"auth_steps\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}}, {"sql":"select to_regclass($1) is not null as found","params":["\"auth_migrations\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}}, {"sql":"select table_name as \"table\", column_name as \"column\", udt_name as \"type\" from information_schema.columns\n where table_schema = current_schema() order by table_name, ordinal_position","result":{"command":"SELECT","rowCount":0,"columns":[["table",19],["column",19],["type",19]],"rows":[]}}, {"repeated":0}, {"sql":"-- The takes table and its index.\ncreate schema if not exists \"limits\";\n\ncreate table if not exists \"limits\".\"takes\" (\n \"key\" bytea primary key,\n \"count\" integer not null,\n \"expires_at\" timestamptz not null\n);\n\ncreate index if not exists \"takes_expires_at\" on \"limits\".\"takes\" (\"expires_at\");\n\n-- The single-use table and its index.\ncreate table if not exists \"limits\".\"single_use\" (\n \"key\" bytea primary key,\n \"value\" jsonb,\n \"expires_at\" timestamptz not null\n);\n\ncreate index if not exists \"single_use_expires_at\" on \"limits\".\"single_use\" (\"expires_at\");","result":[{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]}]}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["root@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["root","root@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","admin","false","false","2026-08-01T00:00:00.000+00:00","9Z9H9VcrD2sAdP9wzAwAVv25Fct2QZz4"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["9Z9H9VcrD2sAdP9wzAwAVv25Fct2QZz4","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["9Z9H9VcrD2sAdP9wzAwAVv25Fct2QZz4","credential","9Z9H9VcrD2sAdP9wzAwAVv25Fct2QZz4","39c98e3c246d0fda11930159b21bd387:1df58eefdce1aabd6cbd96d92144dd75b84603d209356777ba5694ea2884252dca26c47e7b802a1c536db7f4e16efea45bb48af74c241776ef1dbb123639a713","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","9PfoT8qU3LUExF3hQgXoUbe7BbH4ZcUt"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["9PfoT8qU3LUExF3hQgXoUbe7BbH4ZcUt","9Z9H9VcrD2sAdP9wzAwAVv25Fct2QZz4","credential","9Z9H9VcrD2sAdP9wzAwAVv25Fct2QZz4",null,null,null,null,null,null,"39c98e3c246d0fda11930159b21bd387:1df58eefdce1aabd6cbd96d92144dd75b84603d209356777ba5694ea2884252dca26c47e7b802a1c536db7f4e16efea45bb48af74c241776ef1dbb123639a713","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["9Z9H9VcrD2sAdP9wzAwAVv25Fct2QZz4","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["alice@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["alice","alice@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","user","false","false","2026-08-01T00:00:00.000+00:00","MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK","credential","MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK","7732a514c0dab8db2e39fd99b6675712:93c48494e2f43b5321e800ed721ee324a2719b3514ed2c29a7180143e7fb4e6cfecd5df33506c3669923d358322e85ca746b07f856026621ca9e113d82ce9a72","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","YAW0tv0xezdlF0RoChehWAzQ94ga1xay"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["YAW0tv0xezdlF0RoChehWAzQ94ga1xay","MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK","credential","MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK",null,null,null,null,null,null,"7732a514c0dab8db2e39fd99b6675712:93c48494e2f43b5321e800ed721ee324a2719b3514ed2c29a7180143e7fb4e6cfecd5df33506c3669923d358322e85ca746b07f856026621ca9e113d82ce9a72","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["9Z9H9VcrD2sAdP9wzAwAVv25Fct2QZz4","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["bob@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["bob","bob@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","user","false","false","2026-08-01T00:00:00.000+00:00","dWiaVKYb5mquM2IKfsiS6yx0vgjpHDWd"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["dWiaVKYb5mquM2IKfsiS6yx0vgjpHDWd","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["dWiaVKYb5mquM2IKfsiS6yx0vgjpHDWd","credential","dWiaVKYb5mquM2IKfsiS6yx0vgjpHDWd","e412c5647781d32c2f585dd21d79d24e:1b7f85832acb466e28b57b33d04253e15c4c4b5994de5e8426ac3184df5e807181e7f159981d99e9fd6b7cab086ca5d51bb2dd7a928afa5cab6afe30337b5953","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","xu6Gsa30KnDXjfvMOxA8i6SYBx5TdmbP"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["xu6Gsa30KnDXjfvMOxA8i6SYBx5TdmbP","dWiaVKYb5mquM2IKfsiS6yx0vgjpHDWd","credential","dWiaVKYb5mquM2IKfsiS6yx0vgjpHDWd",null,null,null,null,null,null,"e412c5647781d32c2f585dd21d79d24e:1b7f85832acb466e28b57b33d04253e15c4c4b5994de5e8426ac3184df5e807181e7f159981d99e9fd6b7cab086ca5d51bb2dd7a928afa5cab6afe30337b5953","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"delete from \"limits\".\"takes\" where \"expires_at\" <= $1","params":["2026-08-01T00:00:00.000+00:00"],"result":{"command":"DELETE","rowCount":0,"columns":[],"rows":[]}}, {"sql":"insert into \"limits\".\"takes\" as t (\"key\", \"count\", \"expires_at\") values ($1, 1, $2)\n on conflict (\"key\") do update set\n \"count\" = case when t.\"expires_at\" <= $3 then 1 else t.\"count\" + 1 end,\n \"expires_at\" = case when t.\"expires_at\" <= $4 then excluded.\"expires_at\" else t.\"expires_at\" end\n returning \"count\", \"expires_at\"","params":[{"hex":"6654a6a87b8bb86a082f93fb47814d79db23d5b0cf3fd9331506f2d5805e181f"},"2026-08-01T00:01:00.000+00:00","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00"],"result":{"command":"INSERT","rowCount":1,"columns":[["count",23],["expires_at",1184]],"rows":[["1","2026-08-01 00:01:00+00"]]}}, {"sql":"select \"primary\".* from (select * from \"sign_in_policy\" order by \"created_at\" desc limit $1) as \"primary\" order by \"created_at\" desc","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["password",25],["email_code",25],["passkey",25],["two_factor",25],["staff_access",25],["platform_sign_in",25],["created_at",1184],["created_by",25]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["alice@example.com"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"account\" where \"account\".\"user_id\" = $1 limit $2) as \"primary\"","params":["MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK","100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["YAW0tv0xezdlF0RoChehWAzQ94ga1xay","MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK","credential","MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK",null,null,null,null,null,null,"7732a514c0dab8db2e39fd99b6675712:93c48494e2f43b5321e800ed721ee324a2719b3514ed2c29a7180143e7fb4e6cfecd5df33506c3669923d358322e85ca746b07f856026621ca9e113d82ce9a72","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"session\" (\"expires_at\", \"token\", \"created_at\", \"updated_at\", \"ip_address\", \"user_agent\", \"user_id\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8) returning *","params":["2026-08-08T00:00:00.000+00:00","iY1NTz0m5W2oDfwuzyq6Y9i5nBPCxj4O","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","127.0.0.1","","MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK","GEK5WcgJMqF49GT75Z6LnYA4AVzdVj8q"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["GEK5WcgJMqF49GT75Z6LnYA4AVzdVj8q","2026-08-08 00:00:00+00","iY1NTz0m5W2oDfwuzyq6Y9i5nBPCxj4O","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[]}}, {"sql":"insert into \"jwks\" (\"public_key\", \"private_key\", \"created_at\", \"expires_at\", \"alg\", \"crv\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"cx7U-BxVPzFZu4StbPXTD2R6EOSPaPw5GqkWUJb4-aE\"}","\"$ba$205908829$5366b2b26075bf02f45b15d1243fa573870c628b2304d4924ca69490138e13bcfed3be0aafedbd84632feef64300719083278459270e86b04819cd366e3793b2518b96faa5c86934bcd256c6f725c416ea201a18aad543c34458a986a66214837572eecd08a32159aa8029b7e87e3b706144c360e53d6ac3fec9e61bc69a797968bc5b46d3bb085a16948896dee7e13252f87023e3e45dceafa05a8849633f7a9ca8ee8d48c9eba25b\"","2026-08-01T00:00:00.000+00:00","2026-08-31T00:00:00.000+00:00","EdDSA","Ed25519","IXHVA2jVVg1MvP7ZPxEhpUwXGwIOEoEF"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["IXHVA2jVVg1MvP7ZPxEhpUwXGwIOEoEF","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"cx7U-BxVPzFZu4StbPXTD2R6EOSPaPw5GqkWUJb4-aE\"}","\"$ba$205908829$5366b2b26075bf02f45b15d1243fa573870c628b2304d4924ca69490138e13bcfed3be0aafedbd84632feef64300719083278459270e86b04819cd366e3793b2518b96faa5c86934bcd256c6f725c416ea201a18aad543c34458a986a66214837572eecd08a32159aa8029b7e87e3b706144c360e53d6ac3fec9e61bc69a797968bc5b46d3bb085a16948896dee7e13252f87023e3e45dceafa05a8849633f7a9ca8ee8d48c9eba25b\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"sign_in_policy\" order by \"created_at\" desc limit $1) as \"primary\" order by \"created_at\" desc","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["password",25],["email_code",25],["passkey",25],["two_factor",25],["staff_access",25],["platform_sign_in",25],["created_at",1184],["created_by",25]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"token\" = $1) as \"primary\"","params":["iY1NTz0m5W2oDfwuzyq6Y9i5nBPCxj4O"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["GEK5WcgJMqF49GT75Z6LnYA4AVzdVj8q","2026-08-08 00:00:00+00","iY1NTz0m5W2oDfwuzyq6Y9i5nBPCxj4O","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select coalesce((select \"rev\" from \"token_revision\" where id = $1), 0) as rev","params":["MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK"],"result":{"command":"SELECT","rowCount":1,"columns":[["rev",20]],"rows":[["0"]]}}, {"sql":"select \"primary\".* from (select * from \"session\" where \"session\".\"id\" = $1) as \"primary\"","params":["GEK5WcgJMqF49GT75Z6LnYA4AVzdVj8q"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["expires_at",1184],["token",25],["created_at",1184],["updated_at",1184],["ip_address",25],["user_agent",25],["user_id",25],["impersonated_by",25],["active_role",25]],"rows":[["GEK5WcgJMqF49GT75Z6LnYA4AVzdVj8q","2026-08-08 00:00:00+00","iY1NTz0m5W2oDfwuzyq6Y9i5nBPCxj4O","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","127.0.0.1","","MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK",null,null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["MP6STBFcTExrU7UUc5zKQJDCoXfjM7XK","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["IXHVA2jVVg1MvP7ZPxEhpUwXGwIOEoEF","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"cx7U-BxVPzFZu4StbPXTD2R6EOSPaPw5GqkWUJb4-aE\"}","\"$ba$205908829$5366b2b26075bf02f45b15d1243fa573870c628b2304d4924ca69490138e13bcfed3be0aafedbd84632feef64300719083278459270e86b04819cd366e3793b2518b96faa5c86934bcd256c6f725c416ea201a18aad543c34458a986a66214837572eecd08a32159aa8029b7e87e3b706144c360e53d6ac3fec9e61bc69a797968bc5b46d3bb085a16948896dee7e13252f87023e3e45dceafa05a8849633f7a9ca8ee8d48c9eba25b\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["IXHVA2jVVg1MvP7ZPxEhpUwXGwIOEoEF","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"cx7U-BxVPzFZu4StbPXTD2R6EOSPaPw5GqkWUJb4-aE\"}","\"$ba$205908829$5366b2b26075bf02f45b15d1243fa573870c628b2304d4924ca69490138e13bcfed3be0aafedbd84632feef64300719083278459270e86b04819cd366e3793b2518b96faa5c86934bcd256c6f725c416ea201a18aad543c34458a986a66214837572eecd08a32159aa8029b7e87e3b706144c360e53d6ac3fec9e61bc69a797968bc5b46d3bb085a16948896dee7e13252f87023e3e45dceafa05a8849633f7a9ca8ee8d48c9eba25b\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"repeated":2} ] }, "the devices endpoints with auth > refuse a token that stands for no one's own sign-in session": { "the devices endpoints with auth > refuse a token that stands for no one's own sign-in session#0": [ {"sql":"select to_regclass($1) is not null as found","params":["\"auth_steps\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}}, {"sql":"select to_regclass($1) is not null as found","params":["\"auth_migrations\""],"result":{"command":"SELECT","rowCount":1,"columns":[["found",16]],"rows":[["f"]]}}, {"sql":"select table_name as \"table\", column_name as \"column\", udt_name as \"type\" from information_schema.columns\n where table_schema = current_schema() order by table_name, ordinal_position","result":{"command":"SELECT","rowCount":0,"columns":[["table",19],["column",19],["type",19]],"rows":[]}}, {"repeated":0}, {"sql":"-- The takes table and its index.\ncreate schema if not exists \"limits\";\n\ncreate table if not exists \"limits\".\"takes\" (\n \"key\" bytea primary key,\n \"count\" integer not null,\n \"expires_at\" timestamptz not null\n);\n\ncreate index if not exists \"takes_expires_at\" on \"limits\".\"takes\" (\"expires_at\");\n\n-- The single-use table and its index.\ncreate table if not exists \"limits\".\"single_use\" (\n \"key\" bytea primary key,\n \"value\" jsonb,\n \"expires_at\" timestamptz not null\n);\n\ncreate index if not exists \"single_use_expires_at\" on \"limits\".\"single_use\" (\"expires_at\");","result":[{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]},{"command":"CREATE","rowCount":null,"columns":[],"rows":[]}]}, {"repeated":1}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["root@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["root","root@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","admin","false","false","2026-08-01T00:00:00.000+00:00","wVfuKcnWWEHnV7jA8ageXPPL6Wdzrl48"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["wVfuKcnWWEHnV7jA8ageXPPL6Wdzrl48","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["wVfuKcnWWEHnV7jA8ageXPPL6Wdzrl48","credential","wVfuKcnWWEHnV7jA8ageXPPL6Wdzrl48","d555f0ad278e5d1f0976a933e6c8a61c:3a083e043ef0f8b948c90c7cb5dbaa112f439f16e5e83e504c99ecd604c1a736e00ac61a769b9066323a291a6fff0128038109f801d9da4bce7f2128d68c9dc8","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","9Yr1lWzqYXOIULrzZLUd9zYtTSEte6E8"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["9Yr1lWzqYXOIULrzZLUd9zYtTSEte6E8","wVfuKcnWWEHnV7jA8ageXPPL6Wdzrl48","credential","wVfuKcnWWEHnV7jA8ageXPPL6Wdzrl48",null,null,null,null,null,null,"d555f0ad278e5d1f0976a933e6c8a61c:3a083e043ef0f8b948c90c7cb5dbaa112f439f16e5e83e504c99ecd604c1a736e00ac61a769b9066323a291a6fff0128038109f801d9da4bce7f2128d68c9dc8","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["wVfuKcnWWEHnV7jA8ageXPPL6Wdzrl48","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["alice@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["alice","alice@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","user","false","false","2026-08-01T00:00:00.000+00:00","6ckfz0aZHBsVtuIPLjzt2wZfCOkIqZ9k"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["6ckfz0aZHBsVtuIPLjzt2wZfCOkIqZ9k","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["6ckfz0aZHBsVtuIPLjzt2wZfCOkIqZ9k","credential","6ckfz0aZHBsVtuIPLjzt2wZfCOkIqZ9k","49c5dce652bbe50bc618e403b7cb417d:09181c5b9aa2d5ff40b6c71726624809cf34c317a62e91355de597610c478d7483001e1390b18f9c44bfa7b067ed1a2ba554ac6e94413760f1c7505288f317e1","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","kQhd5HShBycu7T4vaOe3Q6PqWzOxDAlQ"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["kQhd5HShBycu7T4vaOe3Q6PqWzOxDAlQ","6ckfz0aZHBsVtuIPLjzt2wZfCOkIqZ9k","credential","6ckfz0aZHBsVtuIPLjzt2wZfCOkIqZ9k",null,null,null,null,null,null,"49c5dce652bbe50bc618e403b7cb417d:09181c5b9aa2d5ff40b6c71726624809cf34c317a62e91355de597610c478d7483001e1390b18f9c44bfa7b067ed1a2ba554ac6e94413760f1c7505288f317e1","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" limit $1) as \"primary\"","params":["1"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["wVfuKcnWWEHnV7jA8ageXPPL6Wdzrl48","root","root@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","admin","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["bob@example.com"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[]}}, {"sql":"insert into \"user\" (\"name\", \"email\", \"email_verified\", \"created_at\", \"updated_at\", \"role\", \"banned\", \"two_factor_enabled\", \"email_confirmed_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) returning *","params":["bob","bob@example.com","true","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","user","false","false","2026-08-01T00:00:00.000+00:00","GdlT5ymR9SpLKTsfcjtsueF1m52lVajI"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["GdlT5ymR9SpLKTsfcjtsueF1m52lVajI","bob","bob@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"insert into \"account\" (\"account_id\", \"provider_id\", \"user_id\", \"password\", \"created_at\", \"updated_at\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["GdlT5ymR9SpLKTsfcjtsueF1m52lVajI","credential","GdlT5ymR9SpLKTsfcjtsueF1m52lVajI","259fd1eb1ecb8d5655a6f7396754e0aa:561964865c5782ae5dd49e2f636c38dd55762ee52ae5586ca4c8c3a149f3c41f82bdb7866b8a9721e92380d0d17ef26d0e6430e514f4fa3cc91deecb03f4ae2c","2026-08-01T00:00:00.000+00:00","2026-08-01T00:00:00.000+00:00","0sT3rav0BrKXQybzFVxCJXRS8qLlCgkD"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["account_id",25],["provider_id",25],["user_id",25],["access_token",25],["refresh_token",25],["id_token",25],["access_token_expires_at",1184],["refresh_token_expires_at",1184],["scope",25],["password",25],["created_at",1184],["updated_at",1184],["single_subject_user_id",25]],"rows":[["0sT3rav0BrKXQybzFVxCJXRS8qLlCgkD","GdlT5ymR9SpLKTsfcjtsueF1m52lVajI","credential","GdlT5ymR9SpLKTsfcjtsueF1m52lVajI",null,null,null,null,null,null,"259fd1eb1ecb8d5655a6f7396754e0aa:561964865c5782ae5dd49e2f636c38dd55762ee52ae5586ca4c8c3a149f3c41f82bdb7866b8a9721e92380d0d17ef26d0e6430e514f4fa3cc91deecb03f4ae2c","2026-08-01 00:00:00+00","2026-08-01 00:00:00+00",null]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"email\" = $1) as \"primary\"","params":["alice@example.com"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["6ckfz0aZHBsVtuIPLjzt2wZfCOkIqZ9k","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select coalesce((select \"rev\" from \"token_revision\" where id = $1), 0) as rev","params":["6ckfz0aZHBsVtuIPLjzt2wZfCOkIqZ9k"],"result":{"command":"SELECT","rowCount":1,"columns":[["rev",20]],"rows":[["0"]]}}, {"sql":"select \"primary\".* from (select * from \"user\" where \"user\".\"id\" = $1) as \"primary\"","params":["6ckfz0aZHBsVtuIPLjzt2wZfCOkIqZ9k"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["name",25],["email",25],["email_verified",16],["image",25],["created_at",1184],["updated_at",1184],["role",25],["banned",16],["ban_reason",25],["ban_expires",1184],["last_role",25],["email_confirmed_at",1184],["two_factor_enabled",16]],"rows":[["6ckfz0aZHBsVtuIPLjzt2wZfCOkIqZ9k","alice","alice@example.com","t",null,"2026-08-01 00:00:00+00","2026-08-01 00:00:00+00","user","f",null,null,null,"2026-08-01 00:00:00+00","f"]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":0,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[]}}, {"sql":"insert into \"jwks\" (\"public_key\", \"private_key\", \"created_at\", \"expires_at\", \"alg\", \"crv\", \"id\") values ($1, $2, $3, $4, $5, $6, $7) returning *","params":["{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"83xKAztBDdADRyJGEEhezF4Jj2aWylHM8RqsjScmJag\"}","\"$ba$205908829$8089d77d3ff9112f3496d434915c430ea1cb06f363026d4fd8cc9bb175e6b380747d20418eb553d88d1215e013cc7708b1279bb529424da9ae9bac0f13e0b5cab4bf7ac154b2f44c3758c48c0f67da7bee39bee747b23fc4fb07444c23c5ef864482b745750698b557106384f81cc5e80338afbd8c8338949bcfc1b62128c23852376a1adbc39bde8c611c049e686693db2d1fe226a57fb99991958428b6f7f5ea8454d58d66636e09\"","2026-08-01T00:00:00.000+00:00","2026-08-31T00:00:00.000+00:00","EdDSA","Ed25519","DLuTR8jNaBnC2cqWRpouwAxnmTDQpHRv"],"result":{"command":"INSERT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["DLuTR8jNaBnC2cqWRpouwAxnmTDQpHRv","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"83xKAztBDdADRyJGEEhezF4Jj2aWylHM8RqsjScmJag\"}","\"$ba$205908829$8089d77d3ff9112f3496d434915c430ea1cb06f363026d4fd8cc9bb175e6b380747d20418eb553d88d1215e013cc7708b1279bb529424da9ae9bac0f13e0b5cab4bf7ac154b2f44c3758c48c0f67da7bee39bee747b23fc4fb07444c23c5ef864482b745750698b557106384f81cc5e80338afbd8c8338949bcfc1b62128c23852376a1adbc39bde8c611c049e686693db2d1fe226a57fb99991958428b6f7f5ea8454d58d66636e09\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["DLuTR8jNaBnC2cqWRpouwAxnmTDQpHRv","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"83xKAztBDdADRyJGEEhezF4Jj2aWylHM8RqsjScmJag\"}","\"$ba$205908829$8089d77d3ff9112f3496d434915c430ea1cb06f363026d4fd8cc9bb175e6b380747d20418eb553d88d1215e013cc7708b1279bb529424da9ae9bac0f13e0b5cab4bf7ac154b2f44c3758c48c0f67da7bee39bee747b23fc4fb07444c23c5ef864482b745750698b557106384f81cc5e80338afbd8c8338949bcfc1b62128c23852376a1adbc39bde8c611c049e686693db2d1fe226a57fb99991958428b6f7f5ea8454d58d66636e09\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"sql":"select \"primary\".* from (select * from \"jwks\" limit $1) as \"primary\"","params":["100"],"result":{"command":"SELECT","rowCount":1,"columns":[["id",25],["public_key",25],["private_key",25],["created_at",1184],["expires_at",1184],["alg",25],["crv",25]],"rows":[["DLuTR8jNaBnC2cqWRpouwAxnmTDQpHRv","{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"83xKAztBDdADRyJGEEhezF4Jj2aWylHM8RqsjScmJag\"}","\"$ba$205908829$8089d77d3ff9112f3496d434915c430ea1cb06f363026d4fd8cc9bb175e6b380747d20418eb553d88d1215e013cc7708b1279bb529424da9ae9bac0f13e0b5cab4bf7ac154b2f44c3758c48c0f67da7bee39bee747b23fc4fb07444c23c5ef864482b745750698b557106384f81cc5e80338afbd8c8338949bcfc1b62128c23852376a1adbc39bde8c611c049e686693db2d1fe226a57fb99991958428b6f7f5ea8454d58d66636e09\"","2026-08-01 00:00:00+00","2026-08-31 00:00:00+00","EdDSA","Ed25519"]]}}, {"repeated":2}, {"sql":"select token from notifications.devices where user_id = $1 order by token","params":["6ckfz0aZHBsVtuIPLjzt2wZfCOkIqZ9k"],"result":{"command":"SELECT","rowCount":0,"columns":[["token",25]],"rows":[]}} ] } }