Doctrine Column-Aggregation继承

时间:2011-11-25 16:06:33

标签: inheritance symfony1 doctrine column-aggregation

我正在尝试实现Doctrine列聚合继承

我从Doctrine guide复制了Yaml结构并将其粘贴到我的schema.yml文件中:

Entity:
  columns:
    username: string(20)
    password: string(16)
    created_at: timestamp
    updated_at: timestamp

User:
  inheritance:
    extends: Entity
    type: column_aggregation
    keyField: type
    keyValue: 1

Group:
  inheritance:
    extends: Entity
    type: column_aggregation
    keyField: type
    keyValue: 2

但是当我使用symfony命令行中的doctrine:build-modeldoctrine:build-sql命令时,我得到的sql文件包含两条用于创建Entity表的类似行:

CREATE TABLE entity (id BIGINT AUTO_INCREMENT, username VARCHAR(20), password VARCHAR(16), created_at DATETIME, updated_at DATETIME, type VARCHAR(255), INDEX entity_type_idx (type), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE entity (id BIGINT AUTO_INCREMENT, username VARCHAR(20), password VARCHAR(16), created_at DATETIME, updated_at DATETIME, type VARCHAR(255), PRIMARY KEY(id)) ENGINE = INNODB;

当我尝试将其导入我的数据库时,哪个导致错误。

它是Symfony命令行中的内置错误吗?

1 个答案:

答案 0 :(得分:0)

好吧,看起来它是reported bug,它只适用于Doctrine 2