Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

database-migrations

/database-migrations

Zmienia schematy bezpiecznie przez expand-contract, online DDL, wsadowe backfille i świadomość wycofania, przy zmianach schematu produkcyjnego grożących blokadami lub przestojem.

Repozytorium
AI-SKILLS ↗
Licencja
MIT
Ostatnia zmiana repozytorium
05.09.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 05.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Zmienia schematy bezpiecznie przez expand-contract, online DDL, wsadowe backfille i świadomość wycofania, przy zmianach schematu produkcyjnego grożących blokadami lub przestojem.

Oryginalny opis (EN)

Change schemas safely with expand-contract, online DDL, batched backfills, and rollback awareness. Use when altering a production schema or when a migration risks locking or downtime.

Jak działa

  1. Method
  2. Boundaries
Sekcje z nagłówków SKILL.md, w oryginale · 71 linii, 486 słów
Podgląd SKILL.md
---
name: database-migrations
description: Change schemas safely with expand-contract, online DDL, batched backfills, and rollback awareness. Use when altering a production schema or when a migration risks locking or downtime.
---

# Database migrations

A schema migration on a live database is surgery on a running patient:
the old code and new code both run during the transition, the change
may lock a table users depend on, and a botched migration can lose
data. Expand-contract and online techniques make it survivable.

## Method

1. **Split every breaking change into expand and contract.**
   Never change schema and code in one incompatible step.
   Expand: add the new (column, table) in a
   backward-compatible way; deploy code that writes both old
   and new; backfill existing data; switch reads to new;
   only then, a release later, contract (drop the old). This
   is what makes deploys rollback-able across the change
   (see rollback-strategy, blue-green-deployments: the same
   compatibility window).
2. **Make each step backward-compatible.** During the
   migration, the currently-running (old) code must keep
   working against the new schema, and the new code must
   tolerate the old data: because both run simultaneously
   during a rolling deploy (see deployment-pipelines). A
   migration that breaks the running version turns a deploy
   into an outage.
3. **Avoid locks that block production.** A naive
   `ALTER TABLE` can lock the whole table for the duration
   (catastrophic on a large hot table); use online/
   concurrent DDL (`CREATE INDEX CONCURRENTLY`, online
   schema-change tools) that build without blocking reads
   and writes. Know your database's locking behavior for
   each operation before running it on a big table.
4. **Backfill in batches, not one statement.** Updating
   millions of rows in a single transaction holds locks,
   bloats, and can time out; batch it (a few thousand rows
   at a time, with pauses, resumable: see
   script-idempotency, incremental-processing) so it does
   not overwhelm the database or block other work (see
   backpressure). Backfills are their own careful operation,
   separate from the DDL.
5. **Run migrations forward-only, decoupled from code
   deploys.** Migrations apply as their own step, additive
   and forward (see rollback-strategy: you roll back code,
   not schema); a migration framework tracks what has run
   so it applies once and in order. Down-migrations for
   destructive changes are often impossible (the data is
   gone): design so you never need them.
6. **Test on production-like data, back up before
   destructive steps.** A migration that works on an empty
   dev table can lock for an hour on production volume: test
   against a realistic copy (see test-environment-parity),
   and take a verified backup before any irreversible
   contract step (see backup-restore). The migration you
   cannot undo is the one you must be able to restore from.

## Boundaries

- Migrations manage schema evolution within one database;
  changes to schemas other teams consume (events, shared
  contracts) are api-change-management and schema-evolution
  territory, with their own coordination.
- Expand-contract adds steps and calendar time (a breaking
  change spans multiple releases); this is the price of
  zero-downtime and rollback safety, and skipping it is how
  migrations cause outages.
- NoSQL "schemas" migrate differently (often lazily, in
  application code on read: see nosql-modeling); the
  expand-contract *thinking* transfers even where the DDL
  does not.

Wersje

RepozytoriumWynikLicencja
Ta strona · Amey-Thakur/AI-SKILLS90MIT
VasulenkoIllia/claude-code-base100MIT
affaan-m/ECC100MIT
affaan-m/ECC100MIT
reddygopalkrishna/developer-agent-skills100MIT
SHRIJANAGAIN/Nemo-Cli100Apache-2.0
wrongstack/wrongstack90MIT
hugrverk/riggverk90MIT

Migawka bazy z 13.11.2026 · wersja paczki 33338c97561f (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90migrations
    Zmienia działający schemat bazy bez psucia aplikacji: sekwencja expand i contract, bezpieczne blokady DDL, wsadowe backfille oraz osiągalny rollback.
  • 90db-migration
    Pisze bezpieczne migracje schematu i danych bez przestoju, z wypełnianiem partiami i planem wycofania.
  • 100safe-migrations
    Zmienia schemat z danymi bez przestoju, z etapami expand i contract oraz planem wycofania. Przydaje się przy zmianie kolumny lub migracji na produkcji.
  • 100expand-contract
    Planuje i wykonuje bezprzestojowe migracje schematu bazy, zmiany łamiące API i szerokie refaktoryzacje metodą expand-contract.
  • 100database-migration-helper
    Tworzy migracje baz danych i zarządza nimi bezpiecznie, z możliwością wycofania, przy zmianach schematu i dodawaniu indeksów.
  • 100rails-safe-migrations
    Pisze i przegląda migracje Active Record w Rails 8, które można uruchomić podczas obsługi ruchu: indeksy współbieżne, expand and contract i wsadowe backfille w PostgreSQL.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.