Indexer canonical-schema compatibility#
This is a migration-contract inventory, not a deployment signoff or blanket compatibility claim.
The indexer schema starts from the canonical baseline
001_canonical_schema.sql and 002_deployment_registry_seed.sql, which seeds
deployment_registry from the operator deployment map, followed by the
ordered forward migrations in apps/indexer/migrations/ (each pinned in
SHIPPED_SHA256SUMS). Together they create the canonical chain and event
projections, the deployment-scoped external-market, signed-source and
maker-credit tables, and the runtime relations still queried by registered
routes and scheduled jobs; all are listed in
apps/indexer/docs/database-schema.md (unavailable reference).
The schema is source-reviewed and covered by schema-validation and PostgreSQL
integration tests, but still requires a fresh-database and staging rehearsal
before launch.
processed_transactions and failed_webhooks are program-scoped, and
transaction_projection_stages is the durable per-program projection-completion
ledger. Startup schema validation checks the canonical projection columns and
the runtime relation inventory against the baseline.
The following registered route modules issue SQL against runtime relations
rather than the canonical *_projection tables:
- achievements, activity, admin, alerts, attestation, challenges, compliance, creators, exchange, fee-config, handles, leaderboard, legacy markets, notifications, orderbook, orders, positions, responsible-trading, share, stats, status, legacy trades, transaction builders, user, and watchlist.
The following scheduled jobs issue SQL against runtime relations:
- achievement processing, price-alert checking, invariant watchdog, leaderboard snapshots, pull lifecycle metrics, recorder reconciliation, treasury-shard reconciliation, stats aggregation, and streak updates.
Examples of runtime relations include markets, orders, positions,
trades, users, fee_config_history, creator_fee_claims,
referrer_earnings_accounts, price_alerts, watchlists,
invariant_watchdog_runs, and the recorder-reconciliation tables.
The canonical-schema-compatible public slice is the external-market and
signed-source router backed by deployment_registry, external_markets,
external_market_sources, signed_source_markets, maker_rebate_events, and
the canonical *_projection tables. A fresh
canonical database has the source-level relation contract for the full registered
route/job surface, but it must not be called production compatible until the
migration is rehearsed against an empty database and a staging snapshot.
Documentation gates and unit tests do not substitute for that rehearsal.