Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)81k · #1659

migrate-validate

Skill này làm gì

Skill này rà soát các file migration cơ sở dữ liệu chưa được áp dụng, tìm các vấn đề an toàn thường gặp. Nó dành cho lập trình viên muốn bắt lỗi trước khi thay đổi một cơ sở dữ liệu đang chạy.

Khi nào nên dùng

  • ✓Khi bạn có các migration đang chờ và muốn kiểm tra trước khi áp dụng.
  • ✓Khi một migration xóa bảng hoặc cột và cần được rà soát an toàn.
  • ✓Khi bạn muốn một kiểm tra về quy tắc đặt tên và an toàn như một phần của quy trình phát hành.

Liên kết skill

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-migrations/skills/migrate-validate/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-migrations/skills/migrate-validate/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy kiểm tra các migration cơ sở dữ liệu đang chờ của tôi xem có thay đổi rủi ro nào trước khi tôi áp dụng.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill tìm các file migration đang chờ, đọc SQL và kiểm tra mục tiêu khóa ngoại, giá trị mặc định của cột bắt buộc mới, tính đầy đủ của phần hoàn tác, thao tác phá hủy, cách diễn đạt an toàn và cách đặt tên bảng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Migrate Validate

Validate all pending database migrations for correctness, safety, and adherence to best practices.

When to use

Before applying migrations to catch issues early -- foreign key references to non-existent tables, missing rollback SQL, destructive operations without safeguards, and naming convention violations.

Steps

  1. Find pending migrations -- use Glob to list all migration files, cross-reference with applied history via mcp__plugin_ruflo-core_ruflo__memory_search --namespace migrations (or memory_list) to identify pending ones. The memory_* tool family routes by namespace; agentdb_hierarchical-* does NOT (it routes by tier), so use memory_* here.
  2. Parse SQL -- use Read to load each pending .up.sql and .down.sql file and parse the SQL statements
  3. Check foreign keys -- verify that all REFERENCES targets exist in the current schema or in prior migrations (both applied and pending)
  4. Check NOT NULL defaults -- verify that any ADD COLUMN with NOT NULL has a DEFAULT value
  5. Check rollback completeness -- verify every CREATE/ALTER in the UP file has a corresponding DROP/ALTER in the DOWN file
  6. Flag destructive ops -- warn on DROP TABLE, DROP COLUMN, TRUNCATE without explicit confirmation
  7. Check idempotency -- verify IF EXISTS / IF NOT EXISTS is used for safety
  8. Check naming -- verify table names are plural, column names are snake_case, index names follow idx_table_column convention
  9. Store validation patterns -- two paths (per ruflo-cost-tracker ADR-0001 dual-path pattern):
    • Pattern store (typed, recommended): mcp__plugin_ruflo-core_ruflo__agentdb_pattern-store with type: 'migration-validation'. No namespace arg — ReasoningBank routes it.
    • Plain store (namespace-routable): mcp__plugin_ruflo-core_ruflo__memory_store --namespace migrations for validation results tied to a specific migration number.
  10. Report -- display: errors (must fix), warnings (should fix), info (suggestions), with file path and line number for each issue

CLI alternative

npx @claude-flow/cli@latest memory search --query "migration validation results" --namespace migrations
Câu hỏi thường gặp

Thay đổi phá hủy là gì?

Các câu lệnh drop table, drop column và truncate được đánh dấu để bạn xác nhận.

Skill có thay đổi file migration không?

Mô tả nói về việc kiểm tra và báo cáo, nên bạn hãy xem các phát hiện và quyết định cần sửa gì.

Làm sao nó biết migration nào đang chờ?

Nó so sánh các file migration với lịch sử được lưu trong namespace migrations của bộ nhớ.

Chi tiết

Mô tả gốc của tác giả

Validate pending migrations for foreign key consistency, rollback safety, and best practices

repo: ruvnet/ruflo

Độ phổ biến

Sao GitHub
81k
Vị trí xếp hạng
#1659
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự