schema-update

Edit Postgres and Doltgres schemas, generate SQL migrations, and validate with db:check.

4|5|Updated Nov 5, 2025
One-click install
npx skills add https://github.com/cogni-dao/cogni --skill schema-update-cogni-dao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: schema-update
Source: https://github.com/cogni-dao/cogni/tree/main/.claude/skills/schema-update
Command: npx skills add https://github.com/cogni-dao/cogni --skill schema-update-cogni-dao

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a disciplined, repeatable process for editing, migrating, and validating database schemas to prevent drift across environments.

Core Features & Use Cases

  • Canonical workflow: edit the schema TS, generate the migration SQL, and validate changes with journal and snapshot checks.
  • Cross-database support: covers Postgres and Doltgres workflows, including multi-node consistency checks.
  • Pre/post-flight validation: integrates with pnpm db:generate:* and pnpm db:check to ensure migrations are reproducible and auditable.

Quick Start

Begin by editing the core schema TS, run pnpm db:generate:<node>, review the generated SQL and journal, then run pnpm db:check before migrating.

Frequently Asked Questions about schema-update

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely generate SQL migrations from a Drizzle schema?

To safely generate SQL migrations, edit the schema TS file, run pnpm db:generate for the target node, then verify the monotonic journal entries before committing the resulting SQL, journal, and snapshot.

What is the canonical workflow for Postgres schema migration?

The canonical Postgres schema migration workflow involves editing the schema TS, generating migration SQL via pnpm db:generate, validating with pnpm db:check, and committing only after successful validation.

How do I prevent database schema drift across multiple nodes?

To prevent database schema drift across multiple nodes, enforce a procedural workflow that generates migrations per node, validates monotonic journal entries, and runs consistency checks across all involved nodes.

Does this database migration process support both Postgres and Doltgres?

Yes, the database migration process supports both Postgres and Doltgres, providing cross-database schema change workflows including multi-node consistency checks and snapshot management.

Why does my database schema validation fail after generating migrations?

Database schema validation fails when generated migrations have non-monotonic journal entries or snapshot mismatches; run pnpm db:check to ensure migrations are reproducible and auditable before committing.

When do I need to run pnpm db:check for schema changes?

You need to run pnpm db:check after generating migration SQL and before committing, to validate that journal entries are monotonic and snapshots are consistent across all database nodes.