-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Column precision is not specified 2 #6468
Comments
Have you tried creating your own custom type to override the method dbal/src/Platforms/AbstractPlatform.php Line 1388 in 9042447
and bypass your issue? |
We've had a similar discussion in #6455: Postgres also supports |
I don't think this is accurate. If you use DBAL only with Postgres and/or SQLite, you shouldn't have to specify the length. The validation happens during rendering the type DDL by the platform. For example (also note dbal/src/Platforms/PostgreSQLPlatform.php Lines 637 to 646 in 44635a2
|
@morozov I tried to describe the problem here. In DBAL3, all platforms have this similar code: dbal/src/Platforms/PostgreSQLPlatform.php Lines 1129 to 1133 in b35648d
As you can see, if no value is specified, it returns So, ORM expects to always get This is also how in ORM with DBAL4 it "breaks" But of course, this all relates only to VARCHAR and strings. |
Thanks, this workaround worked for me. |
Bug Report
Summary
Given:
Current behaviour
It is impossible to update doctrine-migrations and doctrine-dbal (3.8 -> 4) because dbal broke support for type NUMBER without scale/precision.
The 'correct' way to fix it - by updating all the columns with scale/precision cannot be applied easily (it will take days on the amount of data).
How to reproduce
Create a simple project with Postgres with dependency on doctrine-migrations.
Create a table with a column with type NUMBER without scale/precision.
Create any migration on the schema.
Try to apply the migration.
Get 'Column' precision is not specified' exception.
Expected behaviour
No errors.
A workaround with the possibility to configure default scale/precision project-wise/per-column would work.
The text was updated successfully, but these errors were encountered: