What is Database Migration?

Turkish: Migrasyon

Database migration applies table, column, index, and data transformation changes through versioned files in a controlled way.

What is Database Migration?

Database migration is the practice of versioning schema changes alongside application code. Adding a table, renaming a column, creating an index, or transforming existing data can all be managed through migration files.

How Does It Work?

Each migration file runs in a defined order, and most tools keep a table in the database that records which migrations have already been applied. A developer tests the change locally, commits the file to version control, and the same steps run in test, staging, and production during deployment. Some systems also define a separate down step for rollback.

What Needs Care?

Changing a column on a large table can create locks. Backfilling data may take a long time. Safe production migrations require backward-compatible schema changes, staged rollout, backups, monitoring, and sometimes a separate background data-move process.

ORM tools can make migration generation easier, but direct SQL is often safer for complex performance or data-transformation work.