When I run php artisan migrate:refresh
in the terminal, I get the following error. Why am I getting this error?
[Illuminate\Database\QueryException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'departments' already exists (SQL: create table
departments
(id
int unsigned not null auto_increment primary key,name
varchar(191) not null,deleted_at
timestamp null,created_at
timestamp null,updated_at
timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci engine = InnoDB)[PDOException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'departments' already exists
down
function for departments yet? – Felixdepartments
, it's found to already exist. If you're dropping all tables anyway, it would be easiest to manually drop all tables, and to re-run your migrations. Then runphp artisan migrate:refresh
again to see if anything in your migrations is actually still broken. – fubar