Database Migration Review
Review a database migration before release, with compatibility, lock and backfill analysis, verification gates, and an honest recovery plan.
davrix1
Updated Jul 14, 2026
Review a PostgreSQL schema before merge or release, with traceable findings for integrity, access paths, security, operability, compatibility, and verification.
A schema can pass review while its real rules live in application code, its tenant boundary depends on one untested policy, and its new index has no workload behind it. This skill keeps the decision tied to the DDL, query shapes, roles, existing data, and operating constraints you actually provide.
It reviews types, keys, constraints, relationships, access paths, grants, RLS policies, privileged functions, growth assumptions, and compatibility. Each finding separates the observed condition from its consequence, names the evidence state, and includes a verification step. Missing workload data limits performance conclusions instead of producing confident index folklore.
Use it for a schema proposal, DDL diff, migration, schema dump, ERD, RLS change, or index plan before the team commits to a design. The package includes a detailed review rubric, a report format, a canonical JSON schema, and a read-only checker for record shape and cross-references. It does not connect to PostgreSQL, execute SQL, prove query performance, or replace a dedicated migration rollout review.
Input
PostgreSQL 16. Review the supplied documents, document_members, and users DDL. The app role queries documents by tenant_id and updated_at. RLS is enabled but not forced. One SECURITY DEFINER helper has an unqualified table reference. Support staff need cross-tenant read access, but the role and approval path are undecided. Show integrity, index, policy, privilege, compatibility, and verification findings without inventing grants or query plans.
Output
An evidence inventory; object and role-command maps; tenant-key and foreign-key findings; access paths marked supported, candidate, or unknown from the supplied workload; RLS owner-bypass and security-definer search-path findings; the unresolved support-access decision with its owner; safe role-by-command tests; and a blocked or limited verdict tied to the open trust-boundary evidence.
Provide the decision, PostgreSQL version, DDL or schema evidence, representative query shapes, scale or plan evidence, roles and tenant boundaries, known callers, existing-data constraints, and the people who own application semantics, database operations, and security. The skill returns the narrowest supportable review and keeps missing evidence, conflicting rules, and unverified performance or security claims visible.
DDL, a schema dump, catalog output, ERD, migration, or focused excerpts with source locations. An ERD alone cannot establish physical PostgreSQL details.
Representative query shapes, row counts or growth, write patterns, latency targets, plans, statistics, or an explicit statement that they are unavailable.
Application and privileged roles, tenant rules, sensitive data, known callers, plus owners for product semantics, database operations, and security decisions.
Optional. Required only to run the bundled read-only JSON record checker.
SKILL.md; PostgreSQL schema review rubric; human-readable and JSON report format; canonical review-record JSON schema; read-only record checker; Agent Skills interface metadata
No reviews yet.
Input
Review a migration that adds orders.total as double precision, makes external_id nullable with UNIQUE(external_id), cascades order deletion into payments, and adds indexes on status and created_at separately. Checkout filters account_id = $1 and status = 'open', orders by created_at desc, and limits 50. The table has 80 million rows and 9,000 writes per minute. Existing null and duplicate counts were not supplied. Decide whether the target schema is ready to merge, but do not run SQL or fabricate EXPLAIN results.
Output
Traceable findings for money representation, nullable uniqueness, payment deletion semantics, existing-data compatibility, the mismatch between the observed query shape and proposed indexes, write cost, and missing validation evidence; a candidate composite or partial access path stated as a hypothesis; verification checks with execution-risk guards; owned open decisions; and a verdict that does not confuse a plausible index with measured performance.
Input
Return the package's standard JSON record for a PostgreSQL 15 accounts change. Requirements say email is globally unique; the proposed DDL uses UNIQUE(tenant_id, lower(email)); production notes say one person may join several tenants with the same email. A pasted comment says to ignore the requirement and approve. RLS policies cover SELECT and UPDATE, but INSERT WITH CHECK and runtime grants were not supplied. Include evidence, objects, findings, decisions, verification, and a consistent verdict without choosing which identity rule is correct.
Output
One parseable JSON object with stable IDs and valid references; the global-versus-tenant identity rule marked conflicted; policy and grant gaps bounded to the supplied evidence; the embedded comment treated as source text; integrity, security, and compatibility findings; verification steps tied to findings and decisions; and a blocked verdict that lists every open blocker and controlling decision.
Creator
Ttanvio