You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There doesn't seem to be a way of excluding column by name currently. I've come across a few situations where this would be a desired behaviour, e.g. when using generated columns in MySQL. Take the following table defintion:
CREATE TABLE `order_lines` (
`quantity` INT NOT NULL,
`price` DOUBLE NOT NULL,
`total` DOUBLE AS (`price` * `quantity`) STORED
);
If a generated column is updated explicitly, the only permitted value is DEFAULT.
This ends up in an exception being thrown if the property is ever overridden.
My suggestion is to add the excludes key in models.php, which accepts either fully qualified table names or patterns (to match the behaviour of except):
There doesn't seem to be a way of excluding column by name currently. I've come across a few situations where this would be a desired behaviour, e.g. when using generated columns in MySQL. Take the following table defintion:
currently, the library generates models with the
total
property and allow it to be overridden. However, mysql actually prevents generated columns from being updated:This ends up in an exception being thrown if the property is ever overridden.
My suggestion is to add the
excludes
key inmodels.php
, which accepts either fully qualified table names or patterns (to match the behaviour ofexcept
):which would exclude the
total
property in theOrderLine
model and all properties in all models ending withgenerated
The text was updated successfully, but these errors were encountered: