Symfony1 Symfony原则:数字字段默认值的正确YAML语法

Symfony1 Symfony原则:数字字段默认值的正确YAML语法,symfony1,doctrine,yaml,Symfony1,Doctrine,Yaml,这是我的schema.yml中的一部分: ProductTags: columns: product_id: { type: integer, notnull: true } tag_id: { type: integer, notnull: true } discount: { type: numeric, size: 3, scale: 1, notnull: true, default: 0 } 但是,当生成sql时,折扣字段会显示默认关键字,但后面没有默认值

这是我的schema.yml中的一部分:

ProductTags:
  columns:
    product_id: { type: integer, notnull: true }
    tag_id: { type: integer, notnull: true }
    discount: { type: numeric, size: 3, scale: 1, notnull: true, default: 0 }
但是,当生成sql时,折扣字段会显示默认关键字,但后面没有默认值


我怎样才能得到正确的结果?

我认为这是一个理论问题,而不是一个理论问题,我也这么认为。但是我如何解决这个问题呢?对于数据类型,请尝试将默认值转换为字符串(vs int):
default:'0'
“numeric”是pgSQL类型。我认为您需要使用“float”或“decimal”作为原则来正确应用默认值。。。这至少是条令文件所暗示的。