开发者

Table generation from schema causes SQL error

I have the following schema for the generation of a table/model class named Account:

Account:
  actAs:
    Timestampable: ~
    SoftDelete:
      name: deleted
      type: boolean
  columns:
    branch_code:
      type: integer
      notnull: true
    state_id:
      type: integer
      notnull: true
    state_description:
      type: string(20)
      notnull: true
    number:
      type: integer
      notnull: true
    client_name:
      type: string(100)
      notnull: true
    client_code:
      type: integer
      notnull: true
    associated_do:
      type: integer
      notnull: true
    loan_start_date:
      type: datetime
      notnull: true
    first_missing_payment:
      type: datetime
      notnull: true
    delay:
      type: integer
      notnull: true
    balance:
      type: float
      notnull: true
    limit:
      type: float
      notnull: true
    lawyer_id:
      type: integer
    internal_user_id:
      type: integer
    solicitor_id:
      type: integer
  relations:
     Lawyer:
       local: lawyer_id
       foreign: id
     InternalUser:
       local: internal_user_id
       fo开发者_运维技巧reign: id
     Solicitor:
       local: solicitor_id
       foreign: id
     Branch:
       local: branch_code
       foreign: code
     Evolutions:
       type: many
       class: Evolution
       local: id  
       foreign: account_id

When I run the symfony task to reload the database, occurs the error below (truncated for readability):

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit FLOAT(18, 2) NOT NULL, lawyer_id BIGINT, ...) ENGINE = INNODB


I was trying to declare a columns named limit which is a SQL reserved keyword.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜