When you create a new column in a table you can use the ->after('column name') to dictate where it goes. How can I create a migration that re-orders the columns in the right order I want?
Try this, hope it help you to find right solution:
public function up() { DB::statement("ALTER TABLE example MODIFY COLUMN foo DATE AFTER bar"); } public function down() { DB::statement("ALTER TABLE example MODIFY COLUMN foo DATE AFTER bar"); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With