Borrowing it
Nothing to install: this file belongs to AI-agents-incubator/n8n-pilot. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/AI-agents-incubator/n8n-pilot/main/.claude/commands/db-migrate.mdgit clone --depth 1 https://github.com/AI-agents-incubator/n8n-pilotWrote 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/ai-agents-incubator/n8n-pilot/db-migrate)<a href="https://agentmods.dev/commands/ai-agents-incubator/n8n-pilot/db-migrate"><img src="https://agentmods.dev/badge/commands/ai-agents-incubator/n8n-pilot/db-migrate/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/commands/ai-agents-incubator/n8n-pilot/db-migrate"><img src="https://agentmods.dev/badge/commands/ai-agents-incubator/n8n-pilot/db-migrate.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.00009 | $0.02220 |
| Opus 5 | $0.00005 | $0.01110 |
| Sonnet 5 | $0.00002 | $0.00444 |
| Haiku 4.5 | $0.00001 | $0.00222 |
Grade A, and why
db-migrate 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 340 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Создай database migration следуя лучшим практикам.
ВАЖНО: Миграции - критическая часть. Тестируй все тщательно!
Процесс:
1. Анализ текущей схемы БД
Прочитай и проанализируй:
# Найди файлы схемы БД
find . -name "schema.*" -o -name "*.prisma" -o -name "*migration*"
# Посмотри последние миграции
ls -la supabase/migrations/ || ls -la prisma/migrations/ || ls -la migrations/
Прочитай:
- Текущую схему БД
- Последние миграции
- Database documentation (если есть в ARCHITECTURE.md)
2. Пойми требования
Спроси себя:
- Какие изменения в схеме нужны?
- Есть ли существующие данные, которые нужно сохранить?
- Нужна ли обратная совместимость?
- Есть ли зависимости от других таблиц?
3. Спланируй миграцию
Типы изменений:
Безопасные (можно делать на проде):
- ✅ ADD column (с DEFAULT или NULL)
- ✅ ADD index (concurrent)
- ✅ ADD new table
- ✅ ADD constraint (NOT VALID, потом VALIDATE)
Опасные (требуют осторожности):
- ⚠️ DROP column (может сломать приложение)
- ⚠️ RENAME column (нужна двухфазная миграция)
- ⚠️ CHANGE column type (может потерять данные)
- ⚠️ ADD NOT NULL (сначала заполни данные)
Очень опасные (только с downtime):
- 🔴 DROP table
- 🔴 CHANGE primary key
- 🔴 Большая структурная переделка
4. Создай migration файл
Naming convention:
YYYYMMDDHHMMSS_descriptive_name.sql
Пример: 20250110120000_add_user_preferences_table.sql
Структура миграции:
-- Migration: Add user preferences table
-- Created: 2025-01-10
-- Author: Claude Code
-- Description: Add table to store user preferences with foreign key to users
-- ============================================
-- Up Migration
-- ============================================
BEGIN;
-- Create table
CREATE TABLE IF NOT EXISTS user_preferences (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
theme VARCHAR(20) DEFAULT 'light' CHECK (theme IN ('light', 'dark', 'auto')),
language VARCHAR(10) DEFAULT 'en',
notifications_enabled BOOLEAN DEFAULT true,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
-- Constraints
CONSTRAINT unique_user_preferences UNIQUE(user_id)
);
-- Create indexes
CREATE INDEX idx_user_preferences_user_id ON user_preferences(user_id);
-- Add comments
COMMENT ON TABLE user_preferences IS 'Stores user-specific preferences';
COMMENT ON COLUMN user_preferences.theme IS 'UI theme preference';
-- Enable Row Level Security
ALTER TABLE user_preferences ENABLE ROW LEVEL SECURITY;
-- Create RLS policies
CREATE POLICY "Users can view own preferences"
ON user_preferences
FOR SELECT
USING (auth.uid() = user_id);
CREATE POLICY "Users can update own preferences"
ON user_preferences
FOR UPDATE
USING (auth.uid() = user_id);
CREATE POLICY "Users can insert own preferences"
ON user_preferences
FOR INSERT
WITH CHECK (auth.uid() = user_id);
COMMIT;
-- ============================================
-- Down Migration (Rollback)
-- ============================================
-- Uncomment to enable rollback:
-- BEGIN;
-- DROP TABLE IF EXISTS user_preferences CASCADE;
-- COMMIT;
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.
- 5d ago First seen · 340 lines · 9 tokens per session scan A cb9a2b836b5b
db-migrate is a command published in the GitHub repository AI-agents-incubator/n8n-pilot (29 stars, last pushed 6mo ago), licensed MIT. It adds 9 tokens to every session and 2,220 once invoked, about $0.0000 per session on Opus 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-09-04.
Other commands, from other repositories
init
Initialize configurations for Supabase local development.
database-setup
Use when a project needs to store data and has no database yet. Setting up Supabase, creating tables, writing queries, and connecting them to the frontend. Written for designers.
ingest
Manually add knowledge to the Weaviate store.
json.batch_delete
Delete multiple JSON documents or paths in one itemwise batch.
json.batch_get
Read multiple JSON values by document and path.
json.index.drop
Drop a JSON secondary index by name.