antiloop / propel-real-enum-behavior
Propel 2 behavior to manage the ENUM type more closely to what enums should be
Installs: 592
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 3
Type:propel-behavior
Requires
- php: >=7.4
- propel/propel: ^2.0.0
This package is not auto-updated.
Last update: 2024-11-02 10:37:58 UTC
README
Requirements
This Behavior was developed for Propel 2.
It was also only tested for MariaDb databases for Spryker Webshops.
Installation
composer require antiloop/propel-real-enum-behavior
schema.xml
Add the behavior either to the root of your database or on the target table.
Here are two examples:
<database ...> <!-- This will add the real-enum behavior for all enums in the database --> <behavior name="real-enum"/> <table name="my_table"> <column name="my_enum" type="ENUM" valueSet="FIRST,SECOND,THIRD" /> </table> </database>
<database ...> <table name="my_table"> <!-- This will add the real-enum behavior for all enums in the table --> <behavior name="real-enum"/> <column name="my_enum" type="ENUM" valueSet="FIRST,SECOND,THIRD" /> </table> </database>
Usage
This behavior does one thing to make usage of ENUMS
easier :
- You will now see the ENUM value from the
valueSet
in the database instead of a number.