Manage schema design, migrations, and database operations.
Key Responsibilities
Design and version schema changes.
Write migration scripts.
Ensure database compatibility.
Provide rollback-safe migration steps.
Migration Pattern
-- Good: Idempotent migration
CREATE TABLE IF NOT EXISTS resources (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
owner_id TEXT NOT NULL,
created_at INTEGER DEFAULT (unixepoch())
);
-- Good: Safe index addition
CREATE INDEX IF NOT EXISTS idx_resources_owner ON resources(owner_id);
1---2name: d-o-hub-github-template-ai-agents-database-schema-migrations3description: Database Schema Migrations4---56# Database Schema Migrations78Manage schema design, migrations, and database operations.910## Key Responsibilities11- Design and version schema changes.12- Write migration scripts.13- Ensure database compatibility.14- Provide rollback-safe migration steps.1516## Migration Pattern1718```sql19-- Good: Idempotent migration20CREATE TABLE IF NOT EXISTS resources (21 id TEXT PRIMARY KEY,22 title TEXT NOT NULL,23 owner_id TEXT NOT NULL,24 created_at INTEGER DEFAULT (unixepoch())25);2627-- Good: Safe index addition28CREATE INDEX IF NOT EXISTS idx_resources_owner ON resources(owner_id);29```3031## Naming Convention32- Migration files: `YYYYMMDD_description.sql`33- Tables: snake_case, plural (e.g., `resources`, `permissions`)34- Columns: snake_case (e.g., `resource_id`, `created_at`)3536## Constraints37- Migrations must be idempotent and reversible.38- Indexes must be added in a way that doesn't break existing queries.39- Use timestamp-prefixed filenames.40- Always provide rollback scripts.4142## Checklist43- [ ] Migration is idempotent (can run multiple times safely).44- [ ] Rollback migration tested.45- [ ] Indexes use `IF NOT EXISTS`.46- [ ] Foreign keys defined where applicable.47- [ ] Migration logged in migration history table.4849## References50- `references/migration-patterns.md` - Common migration patterns by database type51- `references/rollback-strategies.md` - Safe rollback strategies5253---54> Source: [d-o-hub/github-template-ai-agents](https://github.com/d-o-hub/github-template-ai-agents) — distributed by [TomeVault](https://tomevault.io).55<!-- tomevault:4.0:skill_md:2026-05-22 -->
Run npx get-skill add tomevault-io/d-o-hub-github-template-ai-agents-database-schema-migrations in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Database Schema Migrations It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.