php-crud-api icon indicating copy to clipboard operation
php-crud-api copied to clipboard

Allow tinyint(1) to be configured as number, not boolean

Open tiramon opened this issue 5 years ago • 3 comments

I have a table with a tinyint(1) column containing values from 0-2. But all entries are transformed in true/false. I understand why it is transformed into a boolean, because most of the time this datatype is used to represent booleans, but i just want to store values from 0-2 ...

Is there any config i can set so this column is interpreted as number?

tiramon avatar Feb 20 '20 12:02 tiramon

Thank you for creating this issue. This is a very good question.

Is there any config i can set so this column is interpreted as number?

No currently there is not, changing the type or display (!) width is your best option I guess.

mevdschee avatar Feb 20 '20 12:02 mevdschee

changing it to tinyint(2) is a working workaround

tiramon avatar Feb 20 '20 13:02 tiramon

Great workaround, I'm glad that it works for you.

Nevertheless, I'm keeping this ticket open as a feature request.

mevdschee avatar Feb 20 '20 13:02 mevdschee