Migrations has very important role in Laravel 4.x. By using Migrations we can create and update our database and by using Migration we can save time because it will create schema by using single command.
Migrations Creation:
In Laravel 4.x Migrations can be create using the following command.
Command:
`php artisan migrate:make createUserTableName`
when you type this command and see the folder app/database/migrations. Here we can see our migration table has been created according to the timestamp. If we want to indicate our table name then by using --table and --create we can indicate the name of the table.
Command:
php artisan migrate:make tableName --table=users
php artisan migrate:make tableName --create=users
Running Migrations:
Running all migration file we use the command.
Command:
php artisan migrate
Forcing Migrations In Production:
There are are some command which we have to run very carefully because they may cause to lose the data.
0 Comment(s)