【问题标题】:Doctrine Column-Aggregation InheritanceDoctrine Column-聚合继承
【发布时间】:2012-01-06 11:33:24
【问题描述】:

我正在尝试实现 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-model 和 doctrine: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 命令行中的内置错误吗?

【问题讨论】:

  • 奇怪...你是最新的吗?
  • 我想我是.. 我有 symfony 1.4.11 不确定 Doctrine 版本
  • 你知道除了 Symfony 的 CLI 之外的任何工具可以从我的 YAML 文件构建 .sql 吗?
  • symfony 的最新版本是 1.4.15 。嵌入式教义版本中可能存在一些错误修正。请更新。不,我不知道任何其他工具。

标签: inheritance symfony1 doctrine column-aggregation


【解决方案1】:

嗯,它看起来像是 reported bug,它只适用于 Doctrine 2

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-08
    • 2014-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-21
    • 2017-11-23
    • 2014-05-07
    相关资源
    最近更新 更多