sorry for silly question but I'm really facing problem. After migrating all the migration files. When I need another features for my project I have to make another table but When I'm going to migrate the new table using "php artisan migrate:rollback" or "php artisan migrate:rollback step=17" .... all the migration files are migrating this time too and I am losing all previous data. Then How can I migrate only the new one?
-
maybe you are looking for it: https://stackoverflow.com/a/35668344/6329802 – aaron0207 Sep 27 '17 at 16:46
-
just simply use **php artisan migrate** artisan command – sahed moral Sep 27 '17 at 17:04
-
Can I add one column to existing table with migration command? – Roman M. Sep 27 '17 at 17:55
3 Answers
To migrate only new migrations is simple: php artisan migrate
. The way the process works is that Laravel creates a table in your database called migrations. In that table are the names of the migrations that have been run already. If there are new migrations the above command will work.
You can read more about running migrations in the documentation.

- 6,172
- 2
- 32
- 57
To migrate any new migration created php artisan migrate
is the artisan command.
To get the details of all commands php artisan
is the artisan command.
To get the details of any specific command php artisan help command-name-here
.

- 249
- 4
- 19
In the case of creating a new file, you only need to run php artisan migrate
again.
If you want modify original migration file and migrate it again, you can use this package to migrate.
First, install package in your Laravel project:
composer require caloskao/migrate-specific
Register command at app/Console/Kernel.php
:
protected $commands = [
\CalosKao\MigrateSpecific::class
];
Now, run this command to migrate your file
php artisan migrate:specific database/migrations/table.php

- 1,783
- 19
- 28