schema-integrity
Installation
SKILL.md
Schema Integrity
When to Use
Use when working on database schema, migrations, ORM queries, data consistency between web (Prisma) and worker (Drizzle), cross-store reconciliation (Postgres ↔ Aitable.ai), or debugging build failures caused by schema drift. Not for video pipeline, UI design, Stripe, or PayPal billing code.
Critical Rules
- Single PostgreSQL database. Both apps share
DATABASE_URL. Changes affect both. - PostgreSQL is ALWAYS the SSOT. If data differs between Postgres and any external store, Postgres wins.
- Prisma owns web, Drizzle owns worker. Never mix ORMs in the same app.
- Manual sync required. No automated cross-ORM sync. After changing one schema, check the other.
- Run Schema Sentinel before every deploy:
npx tsx tools/schema-sentinel.ts --strict - Build both apps after schema changes: web (
npm run build) AND worker (npm run build). - Update
docs/Aitable Brand Config tableafter adding any table or changing shared fields. - All Aitable syncs are one-way: Postgres → Aitable.ai. Never write from Aitable back to Postgres.