antiloopgmbh/propel-real-enum-behavior

Propel 2 行为,以便更紧密地管理 ENUM 类型,使其更接近枚举应有的状态

安装: 226

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 0

分支: 3

类型:propel-behavior

3.0.0 2024-04-05 09:37 UTC

This package is not auto-updated.

Last update: 2024-09-20 10:09:00 UTC


README

Latest Stable Version Total Downloads License

需求

此行为是为 Propel 2 开发的。
它也仅针对 Spryker Webshops 的 MariaDb 数据库进行了测试。

安装

composer require antiloop/propel-real-enum-behavior

schema.xml

将行为添加到数据库的根目录或目标表中。
以下是两个示例

<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>

用法

此行为通过一项操作使使用 ENUMS 更加容易

  • 现在您将在数据库中看到来自 valueSet 的 ENUM 值,而不是数字。