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

Remove doctrine/dbal and fix migration improper column types #10454

Merged
merged 11 commits into from
Aug 16, 2023

Conversation

NiceAesth
Copy link
Contributor

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

  • Removed doctrine/dbal as a dependency
  • Updated migrations to remove previous workarounds caused by dbal
  • Changed migrations between increment() and bigIncrement() since Laravel always sets it as a primary key causing errors such as SQLSTATE[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

Copy link
Collaborator

@nanaya nanaya left a 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.

@NiceAesth
Copy link
Contributor Author

NiceAesth commented Aug 14, 2023

Of note is that all of the nullable(false) calls are technically not needed anymore. Did not touch those.

Updated schema dump: https://gist.github.com/NiceAesth/5ec5bd065866774eff092d57d7876301

Copy link
Collaborator

@nanaya nanaya left a 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 in database/migrations/2020_05_15_083037_sync_structure.php
  • contest_entries.user_id in database/migrations/2020_05_15_083037_sync_structure.php

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