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

Fix undefined variables in migration #398

Merged
merged 3 commits into from
Mar 12, 2020
Merged

Fix undefined variables in migration #398

merged 3 commits into from
Mar 12, 2020

Conversation

jsprw
Copy link
Contributor

@jsprw jsprw commented Mar 12, 2020

Column names are capitals in MySQL 8.0.19 (MySQL Community Server - GPL). Without the aliases, the columns will be returned like COLUMN_NAME, DATA_TYPE, COLUMN_DEFAULT etc. and causing undefined column properties (for example line 95) and breaking the migration if the table structure is existent (creating the structure from scratch works fine, it is just the updating of existing databases that is broken).

Column names are capitals in MySQL 8.0.19 (MySQL Community Server - GPL). Without the aliases, the columns will be returned like COLUMN_NAME, DATA_TYPE, COLUMN_DEFAULT etc. and causing undefined column properties (for example line 95) and breaking the migration if the table structure is existent (creating the structure from scratch works fine, it is just the updating that is broken).
@B4nan
Copy link
Member

B4nan commented Mar 12, 2020

Interesting, so can this be considered as "fixing support for mysql 8"? As that sounds more understandable from the changelog perspective.

Also please fix the tests, should be just about fixing those snapshots. Otherwise we are good to merge.

@jsprw
Copy link
Contributor Author

jsprw commented Mar 12, 2020

I don't know if it is only MySQL 8, I just started using the migrator and got loads of undefined errors and after looking further into it, it was because of these queries returning the data in capitals.

@B4nan
Copy link
Member

B4nan commented Mar 12, 2020

Well the fix is only in the mysql helper, so I think we can call it this way. Other drivers use different approach/queries to get the column list, so they should be fine.

Anyway, thanks, will release it as part of 3.5 probably later this week.

@B4nan B4nan merged commit 955b0ac into mikro-orm:master Mar 12, 2020
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