A migration is a small, versioned instruction that changes the database: add a table, add a column, rename an index. Laravel records which migrations have already run, so each one is applied exactly once.
This is what lets our products update themselves. When you upload a new version, the product sees the new migrations and applies them, without you running SQL by hand. It also makes updates repeatable: every installation of version 1.7 has the same database structure.
Always back up your database before an update anyway. Migrations are tested, but a backup turns any surprise into a five-minute restore.
0 comments