(edit: answer original question)
if you need to add news columns to existent table, you must:
- create a new migration file:
php artisan make:migration <fileName>
- use
Schema::table()
instead Schema::create()
on the migration file
- add columns like a common migration
- run the migration:
php artisan migrate
example:
//change create for table
//the first param (in this case 'users') must be the table name that you want to add columns
Schema::table('users', function (Blueprint $table) {
//news colums here
$table->string('new_col');
});
EDIT:
answer edited quiestion:
Can I do that or should I do the php artisan make:migration
add_user_type_users ?
-
IS POSIBLE BUT ISN´T THE CORRECT WAY:
Yes you can edit your old migration file BUT if you do that, your nexts php artisan migrate
will not change the already migrate files, and you here you MUST delete your table and his data in this case, and delete from migrations table for run your edited migration file. so this isn´t the answer for production env. If you do dat you take a lot of problems that you would avoid.
maybe you can do this way on a dev. env. because you can delete and create tables everytime you want without lose real data.
-
CORRECT WAY:
you MUST create the new migration file (like the original answer), and you will not have problems with lose data, (unless you want this) and the migration will run on production without remove anyyhing.