0

I'm trying to implement Doctrine column-aggregation inheritance

I copied the Yaml structure from the Doctrine guide and paste it in my schema.yml file:

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

But when I use the doctrine:build-model and doctrine:build-sql commands from symfony's command line, the sql file I get contains two similar lines for creating the Entity table:

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;

Which ofcourse causes an error when I try to import it to my database..

Is it a build-in bug in Symfony's command-line?

asked Nov 25, 2011 at 16:06
4
  • Strange... are you up-to-date? Commented Nov 25, 2011 at 17:26
  • I think I am.. I have symfony 1.4.11 not sure about the Doctrine version Commented Nov 26, 2011 at 7:38
  • Do you know of any tool other than Symfony's CLI to build the .sql from my YAML file? Commented Nov 26, 2011 at 8:01
  • the latest version of symfony is 1.4.15 . There might have been some bugfixes in the embedded doctrine version. Please udpate. And no, I don't know any other tool. Commented Nov 26, 2011 at 9:26

1 Answer 1

0

Well, it looks like it is a reported bug and it will only work in Doctrine 2

answered Nov 27, 2011 at 15:06
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.