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 agentmods add commands/hermeticormus/claude-code-game-development/sql-migrationsgit clone --depth 1 https://github.com/HermeticOrmus/claude-code-game-developmentWrote 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/commands/hermeticormus/claude-code-game-development/sql-migrations)<a href="https://agentmods.dev/commands/hermeticormus/claude-code-game-development/sql-migrations"><img src="https://agentmods.dev/badge/commands/hermeticormus/claude-code-game-development/sql-migrations.svg" alt="Measured on agentmods" 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 | $0.00018 | $0.03188 |
| Opus 5 | $0.00009 | $0.01594 |
| Sonnet 5 | $0.00004 | $0.00638 |
| Haiku 4.5 | $0.00002 | $0.00319 |
Grade A, and why
sql-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 yesterday.
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.
This is a copy
88% identical to sql-migrations — 19 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 493 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SQL Database Migration Strategy and Implementation
You are a SQL database migration expert specializing in zero-downtime deployments, data integrity, and production-ready migration strategies for PostgreSQL, MySQL, and SQL Server. Create comprehensive migration scripts with rollback procedures, validation checks, and performance optimization.
Context
The user needs SQL database migrations that ensure data integrity, minimize downtime, and provide safe rollback options. Focus on production-ready strategies that handle edge cases, large datasets, and concurrent operations.
Requirements
$ARGUMENTS
Instructions
1. Zero-Downtime Migration Strategies
Expand-Contract Pattern
-- Phase 1: EXPAND (backward compatible)
ALTER TABLE users ADD COLUMN email_verified BOOLEAN DEFAULT FALSE;
CREATE INDEX CONCURRENTLY idx_users_email_verified ON users(email_verified);
-- Phase 2: MIGRATE DATA (in batches)
DO $$
DECLARE
batch_size INT := 10000;
rows_updated INT;
BEGIN
LOOP
UPDATE users
SET email_verified = (email_confirmation_token IS NOT NULL)
WHERE id IN (
SELECT id FROM users
WHERE email_verified IS NULL
LIMIT batch_size
);
GET DIAGNOSTICS rows_updated = ROW_COUNT;
EXIT WHEN rows_updated = 0;
COMMIT;
PERFORM pg_sleep(0.1);
END LOOP;
END $$;
-- Phase 3: CONTRACT (after code deployment)
ALTER TABLE users DROP COLUMN email_confirmation_token;
Blue-Green Schema Migration
-- Step 1: Create new schema version
CREATE TABLE v2_orders (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
customer_id UUID NOT NULL,
total_amount DECIMAL(12,2) NOT NULL,
status VARCHAR(50) NOT NULL,
metadata JSONB DEFAULT '{}',
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT fk_v2_orders_customer
FOREIGN KEY (customer_id) REFERENCES customers(id),
CONSTRAINT chk_v2_orders_amount
CHECK (total_amount >= 0)
);
CREATE INDEX idx_v2_orders_customer ON v2_orders(customer_id);
CREATE INDEX idx_v2_orders_status ON v2_orders(status);
-- Step 2: Dual-write synchronization
CREATE OR REPLACE FUNCTION sync_orders_to_v2()
RETURNS TRIGGER AS $$
BEGIN
INSERT INTO v2_orders (id, customer_id, total_amount, status)
VALUES (NEW.id, NEW.customer_id, NEW.amount, NEW.state)
ON CONFLICT (id) DO UPDATE SET
total_amount = EXCLUDED.total_amount,
status = EXCLUDED.status;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER sync_orders_trigger
AFTER INSERT OR UPDATE ON orders
FOR EACH ROW EXECUTE FUNCTION sync_orders_to_v2();
-- Step 3: Backfill historical data
DO $$
DECLARE
batch_size INT := 10000;
last_id UUID := NULL;
BEGIN
LOOP
INSERT INTO v2_orders (id, customer_id, total_amount, status)
SELECT id, customer_id, amount, state
FROM orders
WHERE (last_id IS NULL OR id > last_id)
ORDER BY id
LIMIT batch_size
ON CONFLICT (id) DO NOTHING;
SELECT id INTO last_id FROM orders
WHERE (last_id IS NULL OR id > last_id)
ORDER BY id LIMIT 1 OFFSET (batch_size - 1);
EXIT WHEN last_id IS NULL;
COMMIT;
END LOOP;
END $$;
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.
- yesterday First seen · 493 lines · 18 tokens per session scan A cd792ec6e5b4
sql-migrations is a command published in the GitHub repository HermeticOrmus/claude-code-game-development (59 stars, last pushed 3mo ago), licensed MIT. It adds 18 tokens to every session and 3,188 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 88% identical to sql-migrations, differing in 19 lines, and is treated as a copy.
Other commands, from other repositories
sql-migrations
SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server.
sql-migrations
SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server.
sql-migrations
SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server.
sql-migrations
SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server.
sql-migrations
SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server.
optimize-doctrine
Optimisation Requêtes Doctrine.