-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.8] Add the ability to register custom DBAL types in the schema builder. #28214
Conversation
We should also register the type on other databases, at least on SQL Server (which has a native Why are you overriding Please add a test that checks the generated SQL. |
… the registration of the DBAL types.
@staudenmeir I removed the unnecessary overrides and added the tests. |
@driesvints I made the requested changes. |
Hey, is there a chance someone could explain how to use this to get the dreaded "TINYINT" issue to disappear? I'm still learning and don't know how to use |
@SturmB @driesvints I just want to let you know that i’m still working on a solution to fix the problems with TINYINT, as well as other column types. |
Overview
This pull request aims to resolve issue #8840. In addition to that, it allows you to easily add custom, platform specific DBAL types to the framework in the future.
Quick Summary
When changing an existing column to tinyint, it will produce the following error:
Reproduction
In order to reproduce this error, you'll need to run two migrations. One should create a column and the other should should change the column:
Proposed Solution
In order to solve this problem, i created a "registerCustomDBALType" method in the "Builder" class. This way the platform specific builder can call this method to register their own custom type. In addition to that, the user can register their own type in their project by calling the "registerCustomDBALType" on the "Schema" facade.