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
webdevetc

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



More...


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

How to check if a user is logged in, inside a blade file?

How to get the last character of a string in JS?

How to check if a (blade) view file exists

How to hide certain file types from directory listings

How to add comments in PHP

How to get table column names from a database table in Eloquent?

How to install and use jpegoptim on Linux CentOS

How to find the index of a value in an array in JS?

How to merge/concat two arrays together in JS?

How to find an item by Primary Key in Eloquent, or throw a ModelNotFoundException exception if it isn't found?