开发者

Error with doctrine command line tool

Update

I have now go back to a previous build of doctrine and now the error is:

Invalid schema element named "Roles" at path "RoleResource->columns->relations"

this is whit the same yaml file (see it below)


I have a problem with the doctrine command line tool. When I give the command "build-all-reload", I get te following error:

SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'role_id' doesn't exist in table. Failing Query: "CREATE TABLE resource (id BIGINT AUTO_INCREMENT, name VARCHAR(20), INDEX role_id_idx (role_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB". Failing Query: CREATE TABLE resource (id BIGINT AUTO_INCREMENT, name VARCHAR(20), INDEX role_id_idx (role_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB

My yaml file looks like this:

detect_relations: true

options:
  type: INNODB
  collate: utf8_general_ci
  charset: utf8

Log:
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    priority: tinyint
    priorityName: string(10)
    title: string(250)
    message: text
  actAs:
    Timestampable:
      created:
        type: timestamp
        format: Y-m-d H:i:s
      updated:
        disabled: true

User:
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    username: string(50)
    password: string(40)
  actAs:
    Timestampable:
      created:
        type: timestamp
        format: Y-m-d H:i:s
      updated:
        type: timestamp
 开发者_运维百科       format: Y-m-d H:i:s

Role:
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    name: string(20)
  attributes:
    export: all
    validate: true

RoleResource:
  columns:
    role_id:
      type: integer
      primary: true
    resource_id:
      type: integer
      primary: true
    relations:
      Role:
        foreignAlias: RoleResource
      Resource:
        foreignAlias: RoleResource

Resource:
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    name: string(20)
  relations:
    Roles:
      foreignAlias: Resources
      class: Role
      refClass: RoleResource

Menu:
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    label: string(20)

Artical:
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    title: string
    content: longtext
    css: longtext
    js: longtext

I don't know how to solve this problem.

Can someone please help me?


I downgraded Doctrine.

And there are to spaces to much in the yaml file add the line:

relations:

from the component "RoleResource:"

Thank you for all the help Tom,

Ivo Trompert

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜