I'm working on a Laravel application for a while now, but when I run php artisan migrate
now, all out of a sudden I always get the error:
SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value (SQL: insert into `migrations` (`migration`, `batch`) values (2019_06_05_080701_create_departments_table, 22))
and I have no clue why this happens since thsi never happened before. When I try to migrate a specific migration I get the same error, so what is going on here?
The migration looks like this:
public function up()
{
Schema::create('departments', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('company_id');
$table->string('name');
$table->string('p_number')->nullable();
$table->string('address')->nullable();
$table->string('zipcode')->nullable();
$table->string('city')->nullable();
$table->string('contact_name')->nullable();
$table->string('contact_email')->nullable();
$table->string('contact_phone')->nullable();
$table->timestamps();
});
}
Result of SHOW COLUMNS FROM migrations;