Database

Migration

A version-controlled change to a database schema, such as adding tables, columns, or modifying constraints.

In Depth

Database migration refers to the process of making structured, version-controlled changes to a database schema. Migrations are typically written as code (SQL or ORM-specific syntax) and applied sequentially, allowing teams to evolve their database schema alongside application code. Each migration has an "up" function (applies the change) and a "down" function (reverts it). Migration tools track which migrations have been applied, ensuring consistency across development, staging, and production environments. Popular migration tools include Flyway, Liquibase, Prisma Migrate, Knex.js, and built-in ORM migration systems in frameworks like Django and Rails.

How AI for Database Helps

AI for Database automatically detects schema changes and adapts its understanding of your database structure after migrations.

Related Terms

Ready to try AI for Database?

Query your database in plain English. No SQL required. Start free today.