-
Notifications
You must be signed in to change notification settings - Fork 16
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
index "primary" contains unknown column "id" #19
Comments
+1 I've faced same situation with Laravel 5.8.17. |
The quick solution here is to split your table creation into its own migration, and adding your constraints afterwards in another migration. I need to rewrite how constraints are handle at table creation time. |
I've a migration for an manytomany relation:
The driver throw:
I'm running laravel v5.8.22. The same error is with the laravel default PasswordResetTable. |
@minusmillionaer My apologies for being stretched so thin on time atm. The quick fix here, should be to just add a primary key to an |
So I've noticed an unusual problem - I'm getting the above error when I run a migration that only has:
The full SQL that in the error message is
SQL: create table "flag_node" ("flag_id" integer not null, "node_id" integer not null, primary key ("id"))
If I run the migration again (without changing anything), the migration succeeds.
It appears as if the migration is remembering the previous migration (if there are multiple updates), where I do have
$table->increments('id');
The text was updated successfully, but these errors were encountered: