database-schema-migrations
- Repo stars 0
- Author repo skills-registry
Database Schema Migrations
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);
Naming Convention
- Migration files:
YYYYMMDD_description.sql - Tables: snake_case, plural (e.g.,
resources,permissions) - Columns: snake_case (e.g.,
resource_id,created_at)
Constraints
- Migrations must be idempotent and reversible.
- Indexes must be added in a way that doesn't break existing queries.
- Use timestamp-prefixed filenames.
- Always provide rollback scripts.
Checklist
- Migration is idempotent (can run multiple times safely).
- Rollback migration tested.
- Indexes use
IF NOT EXISTS. - Foreign keys defined where applicable.
- Migration logged in migration history table.
References
references/migration-patterns.md- Common migration patterns by database typereferences/rollback-strategies.md- Safe rollback strategies
<!-- tomevault:4.0:skill_md:2026-05-22 -->Source: d-o-hub/github-template-ai-agents — distributed by TomeVault.
- Fluxly category
- Data
- Author-declared agents
- No explicit declaration found; this is not inferred or tested compatibility
- Static check
- 88 / 100 · heuristic scan, not runtime safety proof
- Author / version / license
- @tomevault-io · no license declared
- Fluxly token estimate
- Lean
- Fluxly setup estimate
- Plug-and-play
- External API key
- No requirement detected
- Detected OS requirements
- Unspecified
- Runtime requirements
- Unspecified
- Detected file/system behavior
-
- Read-only
- Write / modify
- Detected network behavior
- Local-only
- Install commands
- None (reference only)
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
The current SKILL.md does not define a fixed output example. Design and version schema changes. Write migration scripts. Ensure database compatibility.
Migration Pattern
Migration files: YYYYMMDDdescription.sql Tables: snakecase, plural (e.g., resources, permissions) Columns: snakecase (e.g., resourceid, createdat)
Migrations must be idempotent and reversible. Indexes must be added in a way that doesn't break existing queries. Use timestamp-prefixed filenames.
[ ] Migration is idempotent (can run multiple times safely). [ ] Rollback migration tested. [ ] Indexes use IF NOT EXISTS.
references/migration-patterns.md - Common migration patterns by database type references/rollback-strategies.md - Safe rollback strategies Source: d-o-hub/github-template-ai-agents — distributed by TomeVault.
# Database Schema Migrations
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
```sql
-- 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);
```
## Naming Convention
- Migration files: `YYYYMMDD_description.sql`
- Tables: snake_case, plural (e.g., `resources`, `permissions`)
- Columns: snake_case (e.g., `resource_id`, `created_at`)
## Constraints
- Migrations must be idempotent and reversible.
- Indexes must be added in a way that doesn't break existing queries.
- Use timestamp-prefixed filenames.
- Always provide rollback scripts.
## Checklist
- [ ] Migration is idempotent (can run multiple times safely).
- [ ] Rollback migration tested.
- [ ] Indexes use `IF NOT EXISTS`.
- [ ] Foreign keys defined where applicable.
- [ ] Migration logged in migration history table.
## References
- `references/migration-patterns.md` - Common migration patterns by database type
- `references/rollback-strategies.md` - Safe rollback strategies
---
> Source: [d-o-hub/github-template-ai-agents](https://github.com/d-o-hub/github-template-ai-agents) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-22 --> Author text anchors workflow facts; Fluxly only indexes current sections, terms, files, and commands.
sections -> Key Responsibilities → Migration Pattern → Naming Convention → Constraints → Checklist → References
terms -> Manage schema design, migrations, and database operations.
files/cmd -> YYYYMMDDdescription.sql · resources · permissions · resourceid · createdat · IF NOT EXISTS · references/migration-patterns.md · references/rollback-strategies.md
body sha256 -> 06d19f972789
Decide Fit First
Design Intent
How To Use It
Boundaries And Review