agentleFS
UfukCetinkaya57UfukCetinkaya57/backend-governance/.claude/skills/migration-checklist/SKILL.md

migration-checklist

Skill0 starsChanged 5 months agoMITView on GitHub

Veritabani migration oncesi kontrol listesi ve rollback proseduru

The file

Files
SKILL.md

Migration Kontrol Listesi

Migration yazmadan ONCE ve yazdiktan SONRA bu kontrol listesini uygula.

Migration ONCESI Kontrol

1. Etki Analizi

  • Hangi tablolar etkileniyor?
  • Mevcut veri kaybolur mu? (kolon silme, tip degistirme, tablo silme)
  • Mevcut veri donusumu gerekiyor mu? (data migration)
  • Diger tablolarla FK iliskisi var mi?
  • Index etkileniyor mu?

Veri kaybeden migration varsa: Team Lead'e raporla, ADR gerekli.

2. Isimlendirme Kontrol

OgeKuralKontrol
Tablosnake_case, cogulusers, order_items
Kolonsnake_casefirst_name, created_at
FK{entity}_iduser_id, order_id
Booleanis_ / has_ prefixis_active, has_permission
Timestamp_at suffixcreated_at, updated_at
Indexix_{tablo}_{kolon}ix_users_email
Uniqueuq_{tablo}_{kolon}uq_users_email

3. Zorunlu Alanlar

Yeni tablo olusturuluyorsa, su alanlar ZORUNLU:

  • id — PK (UUID v7 onerilen / ULID / auto-increment)
  • created_at — olusturulma (default: now)
  • updated_at — guncelleme (auto-update)
  • Soft delete gerekiyorsa: deleted_at (nullable)

4. Index Kontrolu

  • FK alanlarina index eklendi mi?
  • Unique constraint gereken alanlara unique index eklendi mi?
  • Sik WHERE kosulunda kullanilacak alanlara index eklendi mi?
  • Composite index gerekiyorsa siralama dogru mu? (en secici alan ilk)

5. Veri Tipleri

AmacDogru TipYANLIS Tip
Para/fiyatDECIMAL(18,2)FLOAT, DOUBLE
BooleanBOOLEANINT, TINYINT
TarihTIMESTAMP WITH TIMEZONEVARCHAR, DATE (saat kaybeder)
PKUUID v7 / BIGINTVARCHAR

Migration YAZARKEN

Rollback (Down) Kurallari

  • Rollback metodu ASLA bos birakilmaz
  • Kolon ekleme → rollback: kolonu sil
  • Tablo ekleme → rollback: tabloyu sil (DROP)
  • Kolon silme → rollback: kolonu geri ekle (veri kaybolur — bunu dokumante et)
  • Tip degistirme → rollback: eski tipe geri don

Rollback yazilamazsa (geri donulemez degisiklik):

  1. Migration comment'inde acikca belirt: // IRREVERSIBLE: {neden}
  2. Team Lead'e raporla
  3. ADR gerektirir

Migration Atomikligi

  • Her migration TEK bir degisiklik yapmali
  • "Tablo olustur + 3 kolon ekle + index ekle" = TEK migration (ayni tablo)
  • "Tablo A olustur + Tablo B'ye kolon ekle" = AYRI migration'lar

Migration SONRASI Kontrol

  • Migration yukarı (up) calisiyor mu?
  • Rollback (down) calisiyor mu?
  • Mevcut veri bozulmuyor mu? (var olan kayitlar)
  • FK constraint'leri dogru calisiyor mu?
  • Index'ler olusmus mu?
  • Cascade delete/update kurallari acikca belirtilmis mi?

Commit Mesaji

Migration iceren commit'lerde mesajda su bilgiler ZORUNLU:

  • Hangi tablo/alan etkileniyor
  • Migration dosyasinin adi
  • Rollback gerektirip gerektirmedigi (geri donulemez ise acikca belirt)

Ornek: feat: users tablosuna phone_number alani eklendi (migration: 20260306_add_phone_to_users, rollback mevcut)

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.