db
db copied to clipboard
Wrong ColumnSchema::getColumnPhpType for decimal type
Good day. I have my own custom realization for AR::save with ignored not changed rows (for multiple updates from cron). But today i found that it sometimes not works. It was happend if row have decimal DB type, because ColumnSchema::getColumnPhpType returns string for this type (mybe some other types). And as result i have for example string "10" as current value and string "10.00" as oldValue.
Could you write the structure of the table, and if the error occurs in AR or DB, to reproduce it correctly, thanks.
Thanks for posting in our issue tracker. In order to properly assist you, we need additional information:
- When does the issue occur?
- What do you see?
- What was the expected result?
- Can you supply us with a stacktrace? (optional)
- Do you have exact code to reproduce it? Maybe a PHPUnit tests that fails? (optional)
Thanks!
This is an automated comment, triggered by adding the label status:need more info.
Could you write the structure of the table, and if the error occurs in
ARorDB, to reproduce it correctly, thanks.
Hi - this attached archive contains migration, my abstract record, AR to work with test table and test command. i'm using pgsql and i have that test result. As you can see - decimal returns and casted to string instead of float

@Gerych1984 check please