Reader Stacks

TOPIC

Database Migrations

Schema changes, column types, and evolving a database safely.

Laravel Migrations: Renaming and Dropping Columns

Renaming a column, dropping one, and dropping a foreign key each have a specific gotcha — a dependency on doctrine/dbal for renames on older Laravel, and getting the foreign key's actual constraint name right for drops.

Laravel Database Seeders: Creating and Running Them

A seeder fills the database with rows — for lookup data every environment needs, or for realistic fake data during local development. Which one it is changes how you should write it.

Laravel Migrations: Creating and Running Them

A migration is a version-controlled, reversible description of one schema change — the file, the up()/down() methods, and the commands that actually apply or undo it.