-
Notifications
You must be signed in to change notification settings - Fork 387
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
Remove doctrine/dbal
and fix migration improper column types
#10454
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like nullable setting isn't preserved on schema change with native migration.
Of note is that all of the Updated schema dump: https://gist.github.com/NiceAesth/5ec5bd065866774eff092d57d7876301 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still missing nullable:
changelog_entries.github_user_id
indatabase/migrations/2020_05_15_083037_sync_structure.php
contest_entries.user_id
indatabase/migrations/2020_05_15_083037_sync_structure.php
Addresses #10453
Summary
Ever since laravel/framework#45487, Laravel has added support for column modifying which dropped
doctrine/dbal
as a dependency.However, if the package is still installed it will continue to use it for type mappings. This caused issues with certain types which the maintainers chose to not map to mysql/mariadb specific types. (e.g. mediumint and int both being mapped to INTEGER, causing migrations between them to effectively do nothing)
Changes done
doctrine/dbal
as a dependencyincrement()
andbigIncrement()
since Laravel always sets it as a primary key causing errors such asSQLSTATE[42000]: Syntax error or access violation: 1068 Multiple primary key defined (Connection: mysql, SQL: alter table `osu_scores_high` modify `score_id` bigint unsigned not null auto_increment primary key)
Note: JSON type and other MySQL types which previously did not have mappings due to dbal maintainers not wishing to support different versions of SQL now have proper mappings in Laravel 10. Additionally, nullable now also specifies default as null with MySQL.
You may see a schema dump obtained from running the new migrations on a fresh database here