mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-27: schema-tool --create creates a table for a mapped superclass #34
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Oct 1, 2009).
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 (date_created DATETIME NOT NULL, date_updated DATETIME DEFAULT NULL,
date_deleted DATETIME DEFAULT NULL, creator_id INT DEFAULT NULL, updater_id INT DEFAULT NULL,
deleter_id INT DEFAULT NULL) ENGINE = InnoDB
ALTER TABLE Blameable ADD FOREIGN KEY (creator_id) REFERENCES user_users(id)
ALTER TABLE Blameable ADD FOREIGN KEY (updater_id) REFERENCES user_users(id)
ALTER TABLE Blameable ADD FOREIGN KEY (deleter_id) REFERENCES user_users(id)
Only the mapped superclass exists in the classdir. I think it should not create any tables.
@doctrinebot commented on GitHub (Oct 1, 2009):
Comment created by itoijala:
Example class, used to generate output.
@doctrinebot commented on GitHub (Oct 1, 2009):
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 commented on GitHub (Oct 1, 2009):
Comment created by itoijala:
This was with ALPHA1.
@doctrinebot commented on GitHub (Oct 3, 2009):
Comment created by @guilhermeblanco:
Are you able to try same thing with HEAD? If it works I can definately close the issue.
Cheers,
@doctrinebot commented on GitHub (Oct 3, 2009):
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 commented on GitHub (Oct 3, 2009):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 1 attachments from Jira into https://gist.github.com/86351b113820609467db