我正在尝试实现 Doctrine 列聚合继承
我从Doctrine 指南中复制了 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
anddoctrine: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 命令行中的内置错误吗?