I have migrated an existing Laravel 5 application and database. Only no migrations table was there yet, so I created this with the following command:
php artisan
Another way is just create a folder under database/migrations
to put you want skip migrations, this method works for both files that have been migrated or not yet migrated.
# Execute commands in laravel project root folder
mkdir database/migrations/ignored
mv database/migrations/2018_08_14_000000_should_ignore_migration.php \
database/migrations/ignored/
# Check migration has been skipped
php artisan migrate:status
This Artisan CLI extension command is support single command to migrate specific files on Laravel 5.4 or later:
# Install extension
composer require caloskao/migrate-specific
# Migrate
php artisan migrate:specific /path/to/migration_file.php
Once you have the migration table created, insert these records:
insert into migrations(migration, batch) values('2015_12_08_134409_create_tables_script',1);
insert into migrations(migration, batch) values('2015_12_08_134410_create_foreign',1);
insert into migrations(migration, batch) values('2015_12_08_134411_create_index',1);
So artisan will understand those migrations as 'executed'