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.
Related Terms
Database migration changes schema or data structures in versioned steps so the database stays aligned with application code.
ORM MigrationORM migration is the practice of managing database schema changes through code files using ORM tools like Prisma or Drizzle.
ORM (Object-Relational Mapping)ORM maps database tables as objects, allowing database operations without writing raw SQL through library abstractions.
SQL (Structured Query Language)SQL is the standard language for querying, changing, and reporting on structured data stored in relational database tables.