php - How to use laravel migrations
I am using Laravel framework of php for development. I want to use migration for table creation-manipulation. These are the steps I took:
I create migration with command
php artisan migrate:make create_users_table, which create a migration file and in its up function, I wrote down my schema and then I ran it and it got successfully executed.
After that, I tried again run the same migration and as a result, its shows the error that, 'table exist'.
Then I tried to use rollback function but it give error 'nothing to roll back' .
So, how to rollback that migration or to execute down function of migration. Also, when I created new migration and in migration file's up function, I wrote code for dropping table created by my earlier migration and I execute with command
php artisan migrate, by this all migration got executed (also my earlier one) and shows me the error, 'table already exist' (obvious).
So, now I'm stuck, is there a function to execute a special/particular migration? How do I do this?