Sometimes we need to migrate only a specific table/migration file but our command is for all migrations. We can use the php artisan migrate
command to migrate specific file with particular command flags.
First of all, let’s create a migration file with the below given artisan command.
php artisan make:migration create_example_table
It will add the new migration file to the database/migrations
directory. Now we want to run this specific migration.
If we just use the php artisan migrate
command then it will run all the migrations in the path database/migrations.
So, we have to run the migrate command on a specific path with the migration file name included.
php artisan migrate –path=/database/migration/dateString_create_tableName_table.php
As we can see in the above artisan command, we just need to declare the –path
for the migration. Then It will only find one migration and migrate it successfully.
Hope you found it useful. See you in the next quick help.
Today we are going to learn about managing multiple PHP versions on ubuntu with xampp.…
Let's understand about how to use coding to improve your website's SEO. In today’s computerized…
Let's understand the most important linux commands for web developers. Linux, as an open-source and…
Today we are going to discuss top 75+ Laravel interview questions asked by top MNCs.Laravel,…
Today we will discuss about the Mailtrap integration with laravel 10 .Sending and receiving emails…
Today we are going to integrate FCM (Firebase Cloud Messaging) push notifications with ionic application.Firebase…