-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgres String Primary Key Migration Fail #37820
Comments
Most likely caused by #37715 as well. |
@driesvints I have created a project connected to `Postgres. My guess there is something missing in the migration code like this: Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
//...
$table->primary('id);
}); And the error was obvious here and not related to #37715 . |
@khalilst how do you explain this working in v8.47.0 then? It broke after v8.48.0 and that PR is the only database related change. |
@driesvints, brief answer: probably wrong bug report. For more clarification:
@ahawlitschek Please provide steps to reproduce to help me to fix it, no need for the demo project. |
So, I created another a fresh instance and tested each other dependency from our project one by one until I have found the dependency that need to be added in order to achieve this behaviour. Add |
@khalilst the OP's migration is the base sessions table that ships with Laravel: https://github.com/laravel/framework/blob/8.x/src/Illuminate/Session/Console/stubs/database.stub |
@driesvints I have tried it in Laravel 8.48.1 and it was OK, @ahawlitschek Just let me fix it. |
There is also an issue and PR at the |
As @studnitz said: The package name: I think this PR #37826 is not fair because of a third-party package. |
Description:
After Updating to the newest Laravel Version (previously 8.47.0), the default Session migration from Laravel Jetstream causes the following exception:
SQLSTATE[42P16]: Invalid table definition: 7 ERROR: multiple primary keys for table "sessions" are not allowed (SQL: alter table "sessions" add primary key ("id"))
Other migrations with integer primary keys are fully fine.
It seems like the problem is caused by the string primary key.
Here is the migration from jetstream:
We tried this on several machines from different people working on the project.
Steps To Reproduce:
We tried to reproduce this issue with a completely new laravel jetstream project. But the error does not appear.
I will try to create a demo project the next days
The text was updated successfully, but these errors were encountered: