An easy-to-host PDS on the ATProtocol, iPhone and MacOS. Maintain control of your keys and data, always.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(relay): V002 migration — auth + identity tables (MM-138) #4

Summary#

Adds the V002 database migration that creates all 12 Wave 2 tables, forming the schema foundation every other Wave 2 ticket builds on.

  • Account & Identity: accounts, handles, did_documents, signing_keys
  • Device & Provisioning: devices, claim_codes
  • Sessions & Tokens: sessions, refresh_tokens
  • OAuth: oauth_clients, oauth_authorization_codes, oauth_tokens, oauth_par_requests

All FK relationships are wired. WITHOUT ROWID applied to handles, did_documents, oauth_clients, and oauth_par_requests (PK-only access paths). All timestamps are TEXT (ISO-8601), consistent with V001.

Indexes#

Index Type
idx_accounts_email UNIQUE
idx_claim_codes_did INDEX
idx_refresh_tokens_did INDEX
idx_oauth_tokens_did INDEX

Tests#

9 new tests covering:

  • All 12 tables verified to exist via PRAGMA table_info
  • Idempotency (second run_migrations call is a no-op)
  • UNIQUE constraint on accounts.email
  • FK enforcement with PRAGMA foreign_keys = ON
  • EXPLAIN QUERY PLAN confirms all 4 indexes are used by the query planner

Notes#

Existing row-count assertions in the V001 test suite updated to use MIGRATIONS.len() so they stay correct as future migrations are added.

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:web:malpercio.dev/sh.tangled.repo.pull/3mgsqnya3pp22
Diff #0

No differences found between the selected revisions.

History

1 round 0 comments
sign up or login to add to the discussion
malpercio.dev submitted #0
patch application failed: error: No valid patches in input (allow with "--allow-empty")
expand 0 comments