Skip to content
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

Identifier name 'long_table_names_blah_id' is too long #75

Open
jorenvanhee opened this issue Oct 13, 2015 · 0 comments
Open

Identifier name 'long_table_names_blah_id' is too long #75

jorenvanhee opened this issue Oct 13, 2015 · 0 comments

Comments

@jorenvanhee
Copy link

Getting this error:
[PDOException] SQLSTATE[42000]: Syntax error or access violation: 1059 Identifier name 'snow_lesson_category_snow_mo nitor_snow_lesson_category_id_foreign' is too long

With this migration (or with any migration with long table names):
php artisan make:migration:pivot snow_monitors snow_lesson_categories

Can be solved by providing your own shorter key name.

$table->foreign('snow_lesson_category_id', 'snow_lesson_category_foreign')->references('id')->on('snow_lesson_categories')->onDelete('cascade');

This also happened with my primary key.

@tabacitu tabacitu added this to To do in Version 2 via automation Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Version 2
  
To do
Development

No branches or pull requests

2 participants