-- Perauset seed data — idempotent, never runs in production.
-- Applied by `pikku db seed` (and `pikku db reset`).

-- ─── Demo / e2e admin (better-auth credential) ────────────────────────
-- Backs the prefilled login (admin@perauset.org / test) and the e2e suites.
-- password is a better-auth scrypt hash (salt:hash, self-contained).
-- member_roles = app RBAC (full perms via the 'admin' member role); role = the
-- better-auth admin plugin's platform role (gates console access + impersonation).
INSERT OR IGNORE INTO user (id, email, name, display_name, email_verified, member_roles, role, created_at, updated_at) VALUES
  ('u_admin', 'admin@perauset.org', 'Admin', 'Admin', 1, '["admin"]', 'admin', '2026-01-01T00:00:00Z', '2026-01-01T00:00:00Z');

INSERT OR IGNORE INTO account (id, account_id, provider_id, user_id, password, created_at, updated_at) VALUES
  ('acct_u_admin', 'u_admin', 'credential', 'u_admin', '0b27de3eeeab546bf7bce4a94511417b:9f68ffc9cd63e21104cd033699ac9c695ddcb4cb982ea30def1b12751de1012aa12de46cd17c1e4c79276299dc8498e7d177ee59156ab7833d1d026e9d9647b6', '2026-01-01T00:00:00Z', '2026-01-01T00:00:00Z');
