Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add ApexIQ/skillsmith --skill database_migrationsgit clone --depth 1 https://github.com/ApexIQ/skillsmithWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/apexiq/skillsmith/database_migrations)<a href="https://agentmods.dev/skills/apexiq/skillsmith/database_migrations"><img src="https://agentmods.dev/badge/skills/apexiq/skillsmith/database_migrations/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/apexiq/skillsmith/database_migrations"><img src="https://agentmods.dev/badge/skills/apexiq/skillsmith/database_migrations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00027 | $0.00513 |
| Opus 5.5 | $0.00011 | $0.00205 |
| Sonnet 5.5 | $0.00005 | $0.00103 |
| Haiku 4.5 | $0.00003 | $0.00051 |
Grade A, and why
database-migrations scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
🗄️ Database & Migrations
Rule: Never modify production schema without a migration. Never run migrations without a backup.
1. Schema Design (SQLModel)
- Nullable by Default: New columns should be
Optional[T] = Noneto avoid breaking existing rows. - Indexes: Add indexes to columns used in
WHEREclauses (index=True). - Foreign Keys: Always define relationships explicitly.
class Email(SQLModel, table=True):
id: int | None = Field(default=None, primary_key=True)
subject: str = Field(index=True) # Indexed for search
user_id: int = Field(foreign_key="user.id") # FK defined
archived_at: datetime | None = None # Nullable for new column
2. Migration Strategy (Alembic)
Safe Migrations
| Operation | Safe? | Notes |
|---|---|---|
| Add nullable column | ✅ | No data loss, backward compatible. |
| Add non-nullable column | ⚠️ | Needs default value OR multi-step migration. |
| Rename column | ❌ | Breaks existing queries. Use add/copy/drop. |
| Drop column | ⚠️ | Verify no code references it. |
Multi-Step Migration (for risky changes)
- Deploy 1: Add new column (nullable).
- Backfill: Script to populate new column from old.
- Deploy 2: Make new column non-nullable, drop old column.
3. Running Migrations
# Generate migration
alembic revision --autogenerate -m "add archived_at column"
# Review the generated file!
# Then apply:
alembic upgrade head
Examples
- Adding a feature flag column: Add nullable, deploy, backfill, make non-nullable.
Guidelines
- Always backup before migrating production.
- Test migrations on a copy of production data first.
- Never use
DROPin the same deploy as the code change.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 65 lines · 27 tokens per session scan A 210785bc8804
database-migrations is a skill published in the GitHub repository ApexIQ/skillsmith (5 stars, last pushed 7mo ago), licensed MIT. It adds 27 tokens to every session and 513 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
drizzle-orm
Use when modeling data or querying with Drizzle ORM in TypeScript — pgTable schema in .ts, type-safe select/insert/relational queries, drizzle-kit migrations. NOT Prisma Client or schema.prisma (that is prisma-orm), NOT ORM-agnostic migration strategy (that is db-migrations), NOT Postgres engine tuning or EXPLAIN…
postgresdb
Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR). PG16, ORM-agnostic. NOT portable query logic (that is sql), NOT a managed provider's platform…
db-migrations
Use when a schema change must ship without downtime — NOT NULL, rename, type change, or backfilling millions of live rows — for the expand-contract sequence and the lock/batching discipline that keeps each step from freezing prod. NOT lock internals or EXPLAIN (that is postgresdb), NOT drizzle-kit mechanics (that is…
prisma-orm
Use when modeling data or writing type-safe queries with Prisma ORM in TypeScript — schema.prisma, prisma.config.ts, the generated Prisma Client, and Prisma Migrate, including the v6 to v7 upgrade. NOT schema-as-TS with a SQL builder (that is drizzle-orm), NOT ORM-agnostic zero-downtime migration (that is…
database-migration-patterns
Manage database schema changes safely with migration tools, zero-downtime strategies, and rollback procedures. Covers Alembic, SQL migrations, data migrations, and testing strategies. Triggers on database migration, schema changes, or Alembic configuration requests.
database-sql
Design database schemas, write efficient SQL queries, create migrations, and optimize database performance. Use when working with databases, writing queries, or designing data models.