1
$ php artisan migrate

In Connection.php line 647:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' alre
  ady exists (SQL: create table `users` (`id` int unsigned not null auto_incr
  ement primary key, `name` varchar(191) not null, `email` varchar(191) not n
  ull, `password` varchar(191) not null, `remember_token` varchar(100) null,
  `created_at` timestamp null, `updated_at` timestamp null) default character
   set utf8mb4 collate utf8mb4_unicode_ci)


In Connection.php line 449:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' alre
  ady exists

I am trying to add more column into users table but I can't. In terminal I write command php artisan migrate but Base table or view already exists: 1050 Table 'users' already exists. What can I do now?

Barmar
  • 741,623
  • 53
  • 500
  • 612
sam sam
  • 13
  • 4

2 Answers2

0

Use PHP artisan migrate:refresh it will remove all table and create again all or use Schema::table to add more columns

0

You need to reference the table instead of calling the create method

Schema::table('users', function (Blueprint $table) {
    $table->string('email');
});

see Laravel Documentation

Ben V.
  • 211
  • 1
  • 3