DDC-27: schema-tool --create creates a table for a mapped superclass #3440

Closed
doctrinebot opened this Issue Oct 1, 2009 · 7 comments

1 participant

@doctrinebot

Jira issue originally created by user itoijala:

Using the schema-tool to create the database creates a table for a mapped superclass. I think this behaviour is not desired, since the fields of the superclass also exist in the subclass tables. Running php doctrine schema-tool --create --dump-sql --classdir="<...>" generates the following output (MySql):

CREATE TABLE Blameable (datecreated DATETIME NOT NULL, dateupdated DATETIME DEFAULT NULL,
datedeleted DATETIME DEFAULT NULL, creator_id INT DEFAULT NULL, updaterid INT DEFAULT NULL,
deleter_id INT DEFAULT NULL) ENGINE = InnoDB
ALTER TABLE Blameable ADD FOREIGN KEY (creatorid) REFERENCES userusers(id)
ALTER TABLE Blameable ADD FOREIGN KEY (updaterid) REFERENCES userusers(id)
ALTER TABLE Blameable ADD FOREIGN KEY (deleterid) REFERENCES userusers(id)

Only the mapped superclass exists in the classdir. I think it should not create any tables.

@doctrinebot

Comment created by itoijala:

Example class, used to generate output.

@doctrinebot

Comment created by romanb:

Is this with ALPHA1 or the latest code from HEAD? I remember Jon making some fixes recently for mapped superclasses.

@doctrinebot

Comment created by itoijala:

This was with ALPHA1.

@doctrinebot

Comment created by @guilhermeblanco:

Are you able to try same thing with HEAD? If it works I can definately close the issue.

Cheers,

@doctrinebot

Comment created by itoijala:

This works now using HEAD.

No SQL is outputted with --dump-sql and no tables are created for the mapped superclass.

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0-ALPHA2 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment