antiloopgmbh / propel-real-enum-behavior
Propel 2 行为,以便更紧密地管理 ENUM 类型,使其更接近枚举应有的状态
3.0.0
2024-04-05 09:37 UTC
Requires
- php: >=7.4
- propel/propel: ^2.0.0
This package is not auto-updated.
Last update: 2024-09-20 10:09:00 UTC
README
需求
此行为是为 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 值,而不是数字。