agentleFS
TienDat-VnaTienDat-Vna/BackSpec/.agents/skills/db-migration/SKILL.md

db-migration

Skill1 starsChanged 2 months agoMITView on GitHub

Tạo file migration cơ sở dữ liệu mới (Flyway / Liquibase / Alembic / Prisma / golang-migrate) đảm bảo tính bất biến, audit columns, soft delete và không downtime.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md
<!-- GENERATED FROM registry/skills/db-migration/SKILL.md — DO NOT EDIT DIRECTLY --><!-- GENERATED FROM .shared/skills/02-codestyle/db-migration/SKILL.md — DO NOT EDIT DIRECTLY -->

Skill — Database Migration (Backend Microservice)

Hướng dẫn Agent tạo file migration cơ sở dữ liệu an toàn.

Checklist trước khi tạo migration:

  1. Kiểm tra migration cũ: Không bao giờ sửa đổi file migration cũ đã tồn tại.
  2. Xác định phiên bản tiếp theo: Đọc thư mục migration để lấy version tăng dần (vd V2__add_status_column.sql).
  3. Quy chuẩn bắt buộc trong script:
    • Bảng mới phải có cột audit: created_at, updated_at, created_by.
    • Bảng mới phải có cột soft delete: is_deleted hoặc status.
    • Cột thêm vào bảng cũ phải là NULLABLE hoặc có DEFAULT.
    • Tạo Index có điều kiện cho các trường truy vấn thường xuyên.
  4. Cập nhật Entity & DTO: Sau khi viết file migration, cập nhật Entity class và DTO mapping tương ứng.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.