我正在运行带有迁移插件和 Postgresql 数据库的 CakePhp 2.7。创建“数字”类型的字段并指定长度 15,4(比例 15,精度 4 - 或任何长度)实际上不会创建具有该精度和/或比例的字段。
...
'license_fee' => array(
'type' => 'number',
'null' => true,
'length' => '15,6',
'default' => 0
),
...
该字段是使用正确的类型(数字)创建的,但没有比例/精度这里是创建字段的 Postgres 描述。
license_fee | numeric | default 0
我期待看到的是这个
license_fee | numeric(15,6) | default 0
我也尝试使用 'type' => 'decimal' 但同样的事情发生了。迁移插件可能不支持此功能,但我只想知道是否有人确切知道发生了什么。