Safely remove migration In Laravel

Globalz

In Laravel, there appears to be a command for creating a migration, but not removing.

Create migration command:

php artisan migrate:make create_users_table

If I want to delete the migration, can I just safely delete the corresponding migrations file within the database/migrations folder?

Migrations file:

2013_05_31_220658_create_users_table
malisokan

I accidentally created a migration with a bad name (command: php artisan migrate:make). I did not run (php artisan migrate) the migration, so I decided to remove it. My steps:

  1. Manually delete the migration file under app/database/migrations/my_migration_file_name.php
  2. Reset the composer autoload files: composer dump-autoload
  3. Relax

If you did run the migration (php artisan migrate), you may do this:

a) Run migrate:rollback - it is the right way to undo the last migration (Thnx @Jakobud)

b) If migrate:rollback does not work, do it manually (I remember bugs with migrate:rollback in previous versions):

  1. Manually delete the migration file under app/database/migrations/my_migration_file_name.php
  2. Reset the composer autoload files: composer dump-autoload
  3. Modify your database: Remove the last entry from the migrations table

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Qt safely remove a device

From Dev

Safely remove an Android Activity

From Dev

Safely remove USB modem?

From Dev

Search for and remove files safely

From Dev

How to remove a package safely

From Dev

Safely remove a symlink or hardlink

From Dev

Is time a substitute for Safely Remove Hardware?

From Dev

Eject / safely remove vs umount

From Dev

Safely remove old files in /boot

From Dev

How to remove a disk that is not safely removed?

From Dev

equivalent to "safely remove hardware" in Windows

From Dev

Remove constraints in sequelize migration

From Dev

What Laravel cache do I need to clear to remove error about missing migration file?

From Dev

How to safely remove proprietary Intel driver

From Dev

What is the difference between Eject and Safely Remove Device

From Dev

Can I safely remove lubuntu-desktop?

From Dev

How to safely move/remove EFI partition

From Dev

Can I safely remove lubuntu-desktop?

From Dev

What is the difference between "safely remove" and "eject"?

From Dev

Safely remove a USB drive using bat file

From Dev

How to safely move/remove EFI partition

From Dev

What is the difference between Eject and Safely Remove Device

From Dev

How to safely remove a USB external drive?

From Dev

Detect USB after Safely Remove USB

From Dev

Safely Remove Hardware and Eject Media not working

From Dev

Is it possible to completely and safely remove Ubuntu 11.10

From Dev

Can I safely remove /var/cache?

From Dev

Can I safely remove tumbler in Xubuntu 14.04?

From Dev

How to Safely Remove Drive from Raid 1