Add sql table column before or after specific other column - by migrations in Laravel 4.1
laravel, laravel-migrations
Solution
Yes. Create a new migration using `php artisan migrate:make update_users_table`.
Then use the `table` command as follows (if you're using MySQL!):
Schema::table('users', function($table)
{
$table->string('phone_nr')->after('id');
});
Once you've finished your migration, save it and run it using `php artisan migrate` and your table will be updated.
Documentation: https://laravel.com/docs/4.2/migrations#column-modifiers
Problem
Table 'users': ``` |id|name|address|post_code|deleted_at|created_at| ``` and I want add column 'phone_nr' somewhere between 'id' and 'deleted_at' Is it possible by migrations in Laravel 4.1?