While creating and testing migrations files for a MySQL database I receive the following error -
{"error":{"type":"Illuminate\\Database\\QueryException","message":"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.entities' doesn't exist (SQL: select * from `entities`)","file":"\/Applications\/MAMP\/htdocs\/laravel\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Connection.php","line":555}}
What does not make sense is that I am using artisan to run the migrations and nothing in my migrations files is trying to run a SELECT query.
The artisan command I am using is php artisan migrate (also tried resetting with php artisan:reset and php artisan:refresh).
The relevant migration file content is:
public function up()
{
Schema::create('entities', function(Blueprint $table)
{
$table->increments('id')->unsigned();
//..some more columns..
$table->timestamps();
});
}
There are other migration files (total 10 files) but non of them has any dependency on the 'entities' table.
Trying to wrap my head around why artisan is running a SELECT query on the entities table instead of creating the table?
When I manually create the entities table (and add if (!Schema:hasTable('entities') to bypass the creation of the new table), everything works fine so I'm positive that the other migration files are not causing the problem.
Config files and the database connection are all good.
Any help would be greatly appreciated.
Thank you.
increments()function already uses unsigned integers by default.DB::listen()) ?