3

I have created a user migration and then created the table. Here is the command:

php artisan migration:make create_users_table --table=users --create

And then I updated the schema for my desired fields, and ran this command:

php artisan migration

And it works and created the table with all of its field.

Then I again typed the following command to create a new table's schema for comments table"

php artisan migration:make create_comments_table --table=comments --create

And it worked.

And I updated the actual schema of the table, but then when I commanded php artisan migrate it throws an error:

Base table or view already exists. table 'users' ....

Why? because I'm creating the comments table, what it has to do with users table.

2 Answers 2

2

To avoid problems, try creating the tables like these

php artisan migrate:make create_users_table --table=users --create=users

php artisan migrate:make create_comments_table --table=comments --create=comments

taking note of the arguments in --create for each cli command.

Sign up to request clarification or add additional context in comments.

Comments

1

php artisan migrate:make create_comments_table --table=comments --create

The --table and --create options may also be used to indicate the name of the table, and whether the migration will be creating a new table

migrations

1 Comment

Sorry, but I changed the typo that you made before you edit you question again .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.