feat/federation-m2-schema
main
- Add .desc() to all three federation_audit_log created_at indexes for reverse-chronological scans (PRD section 7.3) - Add reserved nullable columns query_hash, outcome, bytes_out per TASKS.md M2-01 spec (written by M4, columns reserved now to avoid retroactive migration) - Regenerate migration 0008 in-place (replaces 0008_careless_lake.sql with 0008_smart_lyja.sql containing DESC indexes + new columns) - Update integration test: add reserved columns to CREATE TABLE in beforeAll; add 7th test for peer→grant cascade delete Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Adds Drizzle ORM schema and migration for federation v1 milestone 2: - New enums: peer_state ('pending'|'active'|'suspended'|'revoked'), grant_status ('active'|'revoked'|'expired') - New tables: federation_peers, federation_grants, federation_audit_log - FK cascades: user delete cascades grants; peer delete set-nulls audit_log - Migration: 0008_careless_lake.sql - Integration tests (FEDERATED_INTEGRATION=1): 6/6 pass No business logic, no services, no DTOs — schema only. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>