Am using Laravel version 8 and I am trying to run php artisan migrate:refresh --seed & php artisan passport:install
The migrations and seeding successfully run but php artisan passport:install fails
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'provider' in 'field list' (SQL: insert into
oauth_clients(user_id,name,secret,provider,redirect,personal_access_client,password_client,revoked,updated_at,created_at) values (?, Laravel Personal Access Client, Wa44O2Z3IA23st3wbgQHvDkapJlS75ZXO7MZ4A4Q, ?, http://localhost, 1, 0, 0, 2021-02-11 15:09:29, 2021-02-11 15:09:29))
Basically while trying to insert the token a column provider is not found and on checking my oauth_clients_table migration file is see that the column provider is actually missing
public function up()
{
Schema::create('oauth_clients', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->nullable()->index();
$table->string('name');
$table->string('secret', 100)->nullable();
$table->text('redirect');
$table->boolean('personal_access_client');
$table->boolean('password_client');
$table->boolean('revoked');
$table->timestamps();
});
}
I seem not to find this information about the column, My questions is since this migrations were generated automatically, before I upgraded my application, what is the structure of this column?
EDIT 1 I have tried below and it failed
$table->string('provider');
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'provider' cannot be null (SQL: insert into
oauth_clients(user_id,name,secret,provider,redirect,personal_access_client,password_client,revoked,updated_at,created_at) values (?, Laravel Personal Access Client, GiZ5BQgqtbbvCuIupO3bhMZHLK0YlIq22LvjWGGG, ?, http://localhost, 1, 0, 0, 2021-02-11 15:33:28, 2021-02-11 15:33:28))
So I added
$table->string('provider')->nullable('web');
The above works but now my question is
- Is the above correct?
- What is the purpose of the
providercolumn inoauth_clientstable?