
database-migrations
Database migration patterns and schema versioning
- Installs
- 60
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/langchain-ai/skills-benchmarks --skill database-migrations- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads database-migrations automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Database Migration Patterns
Manage database schema changes safely and reliably.
Migration File Structure
migrations/
001_create_users.sql
002_add_email_index.sql
003_create_orders.sql
Writing Safe Migrations
Adding Columns
-- migrations/004_add_user_status.sql
-- Up
ALTER TABLE users ADD COLUMN status VARCHAR(20) DEFAULT 'active';
CREATE INDEX idx_users_status ON users(status);
-- Down
DROP INDEX idx_users_status;
ALTER TABLE users DROP COLUMN status;
Creating Tables
-- migrations/005_create_audit_log.sql
-- Up
CREATE TABLE audit_log (
id SERIAL PRIMARY KEY,
table_name VARCHAR(100) NOT NULL,
record_id INTEGER NOT NULL,
action VARCHAR(20) NOT NULL,
changed_by INTEGER REFERENCES users(id),
changed_at TIMESTAMP DEFAULT NOW(),
old_values JSONB,
new_values JSONB
);
CREATE INDEX idx_audit_log_table ON audit_log(table_name, record_id);
CREATE INDEX idx_audit_log_time ON audit_log(changed_at);
-- Down
DROP TABLE audit_log;
Best Practices
- Always include rollback (down) migrations
- Never modify existing migrations - create new ones
- Test migrations on a copy of production data
- Use transactions for atomic changes
- Add indexes concurrently in production:
CREATE INDEX CONCURRENTLY
FAQ
What does the database-migrations skill do?
Database migration patterns and schema versioning
How do I install database-migrations?
Run npx skills add https://github.com/langchain-ai/skills-benchmarks --skill database-migrations in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/database-migrations/ (personal) or .claude/skills/database-migrations/ (project).
Which AI agents can use database-migrations?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is database-migrations safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains database-migrations?
It is published by langchain-ai in langchain-ai/skills-benchmarks, and it is an official skill from the maker of the technology it covers. It has 60 recorded installs.
More from langchain-ai/skills-benchmarks
react-components
langchain-ai/skills-benchmarks
Modern React component patterns with hooks and TypeScript
langgraph-fundamentals
langchain-ai/skills-benchmarks
Open the skill to read its SKILL.md instructions.
langsmith-trace
langchain-ai/skills-benchmarks
Open the skill to read its SKILL.md instructions.
langchain-oss-primer
langchain-ai/skills-benchmarks
Open the skill to read its SKILL.md instructions.
langchain-dependencies
langchain-ai/skills-benchmarks
Open the skill to read its SKILL.md instructions.
deep-agents-core
langchain-ai/skills-benchmarks
Open the skill to read its SKILL.md instructions.
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-driver-adapter-implementation
prisma/skills
Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.