Skip to content

Propel 2 behavior to have MySQL enum data type in your database

License

Notifications You must be signed in to change notification settings

antiloopgmbh/propel-real-enum-behavior

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Propel Real Enum Behavior

Latest Stable Version Total Downloads License

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.

About

Propel 2 behavior to have MySQL enum data type in your database

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%