Passport: Laravel 5.5: can't run migrations (1364 Field 'id' doesn't have a default value)

Created on 26 Oct 2018  路  4Comments  路  Source: laravel/passport

Hello,
I'm just trying to set Passport 4.0.3 up along with Laravel 5.5; I'm using Php 7.2.10 and Mysql 5.7.24 on a Ubuntu 18.04 64bit system.
When I try to run migrations, I get the error:
SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value (SQL: insert intomigrations(migration,batch) values (2016_06_01_000002_create_oauth_access_tokens_table, 8))

The 'oauth_access_tokens' is actually created but the process stops there.

Most helpful comment

The problem was related to my "migrations" table, since on the first environment it missed the "autoincrement" flag on the id field. This is very strange, since I simply imported a working database dump.
By the way, I fixed the issue manually adding the "autoincrement" flag. So sorry for this!

All 4 comments

Testing Passport within the same Laravel project on a different system (ubuntu 16.04, php 7.1.20, mysql 5.7.24) works like a charm!

Please upgrade to the latest Passport and Laravel versions to see if the problem persists. Feel free to report back if the problem still happens after upgrading.

The problem was related to my "migrations" table, since on the first environment it missed the "autoincrement" flag on the id field. This is very strange, since I simply imported a working database dump.
By the way, I fixed the issue manually adding the "autoincrement" flag. So sorry for this!

No problem!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gbgelado picture gbgelado  路  3Comments

SwiTool picture SwiTool  路  3Comments

MarkVilludo picture MarkVilludo  路  3Comments

Adesubomi picture Adesubomi  路  4Comments

mehrancodes picture mehrancodes  路  3Comments