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

MySQL - Including an INT column in Pivot Table Causes invalid SQL Query #267

Merged
merged 2 commits into from
Nov 3, 2024

Conversation

adrianpaiva1
Copy link
Contributor

Looks like the type is listed incorrectly as 'integer' for MySQL instead of 'int'. I'm not sure if 'integer' is used in another DB variation so I left it, happy to remove it if needed.

Including an integer column in the 'getPivotColumns' method with Graphs leads an invalid SQL query with MySQL8 and produces - cast(null as int unsigned) as pivot_my_int_column

calling $my_model->descendantsAndSelf()->get() produces an invalid query.

@staudenmeir
Copy link
Owner

Hi @adrianpaiva1,
Thanks, I'll take a look.

@staudenmeir
Copy link
Owner

staudenmeir commented Nov 3, 2024

I removed the integer type, it's not valid anymore. Laravel 11 changed the way these types are determined and I missed the change from integer to int.

@staudenmeir staudenmeir merged commit 3c4c0d9 into staudenmeir:main Nov 3, 2024
41 checks passed
@staudenmeir
Copy link
Owner

Thanks! I released a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants