LARAVEL - Loss after running the MIGRATE command

0

On Monday I inserted a new migrate into a project where a new table was created.

After running the commands in the local environment and everything works, I upgraded the git from the production server and circled PHP ARTISAN MIGRATE as usual.

It turns out that in one of my tables, most of the data disappeared (it was an account table, with about 700 records).

The result of the migrate in the shell was expected, it appends the insertion of the new table and no error or information that something would have happened to the table "accounts".

Has anyone ever had this error? Fixed a solution?

    
asked by anonymous 06.12.2017 / 17:39

1 answer

0

Do you have the seeders configured and ready with the data that was in the table? If you run only the migrate, you will only re-create the database. Some migration operations are destructive, which means they can cause you to lose data. To protect you from executing these commands in your production database, you are prompted to confirm before the commands are executed. Unless you have used the --force or .env flag it is not set to "production."

To reverse the most recent migration operation, you can use the rollback command. This command rolls back the last "batch" of migrations, which can include multiple migration files:

php artisan migrate:rollback
  

Documentation - Migrations

    
06.12.2017 / 18:04