How to change the order that migrations happen?

Laravel: How to change the order that migrations happen?

Rename the migration file, as it is sorted alphabetically

For example if you change database/migrations/2014_10_12_000000_create_users_table.php to something like
database/migrations/2018_10_11_000000_create_users_table.php then it will be the most recent one processed when doing php artisan migrate.

webdevetc profile pic

I am a 29 year old backend web developer from London, mostly focusing on PHP and Laravel lately. This ( is my blog where I write about some web development topics (PHP, Laravel, Javascript, and some server stuff). contact me here.


Comments and discussion about How to change the order that migrations happen?

Found this interesting? Maybe you want to read some more in this series?

Or see other topics in the Laravel language

Or see other languages/frameworks:
PHP Laravel Composer Apache CentOS and Linux Stuff WordPress General Webdev and Programming Stuff JavaScript
Or see random questions

What is camel case?

How to set up an alias to map one directory to another destination

How to disable file hotlinking in Apache with .htaccess

How to Extract Query String (from a URL) Into an Associative Array in PHP

What are generators in PHP, and how do they compare to arrays?

How to get a route to directly show a view?

How to add the CSRF (Cross-site request forgery) token in Laravel?

How to find the intersection (same values) from two arrays?

How do you run a PHP script from the command line?

How to select what columns to return when calling ::all()