Migrations

Version control for your database schema

Migrations let you define database schema changes in code. They run in order, and can be rolled back.

Generate a migration file that defines a table schema change.

Migration file created, schema not yet defined
Terminal
$ php artisan make:migration create_posts_table
Created Migration: 2024_01_15_create_posts_table.php