What is Database Migration?
Turkish: Veritabanı Göçü (Schema Migration)
Database migration changes schema or data structures in versioned steps so the database stays aligned with application code.
What is Database Migration?
A database migration changes tables, columns, indexes, constraints, and sometimes data through versioned steps. The goal is to keep the database schema aligned with what the application code expects.
How It Works
Each change is recorded as a migration file: adding a column, changing a column type, creating an index, splitting a table, or setting a default value. These files run in order across development, staging, and production. Migration tools track which files have already been applied in a separate table.
Tools such as Prisma, Drizzle, Rails, Django, and Flyway can manage schema migration. With an ORM such as Prisma, migration files make the difference between model definitions and the database visible.
Production Concerns
On large tables, locking ALTER TABLE statements can cause downtime. Larger changes are often split into smaller backward-compatible steps: add the new column, make the application support both fields, backfill data in the background, then remove the old column. This is commonly called an expand-contract approach.
Migration in a database context is not just moving files; it requires backups, rollback planning, schema review, and monitoring. During an ORM migration, automatically generated SQL should be reviewed for production impact.
Related Terms
Database migration applies table, column, index, and data transformation changes through versioned files in a controlled way.
ORM MigrationORM migration is the practice of managing database schema changes through code files using ORM tools like Prisma or Drizzle.
Prisma ORMPrisma is a modern ORM for TypeScript and Node.js that manages database schemas, migrations, and type-safe queries in one workflow.