webdevask.com

Menu

  • Home
  • New
  • Add question

php - Laravel migrate fresh specific migration

View Original

I'm trying to migrate some database tables in my Laravel application. I'm using a third party library https://github.com/spatie/laravel-schedule-monitor which seems to break and requires re-migrating when upgrading. If I run php artisan migrate:fresh locally it'll work just fine, but amongst all of my other migrations I don't want to overwrite and dump the data in my other tables in a production environment.

I want to migrate:fresh a specific migration...

UPDATE

When trying to run the refresh command on a table, the below happens...

monitors

Answer

Solution:

you can use php artisan migrate:refresh --path=

example

php artisan migrate:refresh --path=database/migrations/2020_09_02_000000_create_users_table.php

if you need rollback:

php artisan migrate:rollback  --path=/database/migrations/2020_09_02_000000_create_users_table.php

Answer

Solution:

another solution is to copy whats inside that migration and delete it and re-make that migration and paste data to that and run php artisan migrate

dont forget to dlete the table from phpmyadmin also

Source

See also:

  • php สร้าง Google ชีตจากบัญชีบริการ

  • php - Laravel 8.0 Installation Failed

  • javascript - How to include HTML data (tags) as value in "arrayToDataTable" of Google Pie Chart?

  • how to Grouping array in php

  • php - vender folder from my laravel project has more 1k error

© 2021
E-mail: contact@webdevask.com
Back to top