Details
Description
= Relevant configuration: =
resources.doctrine.driver.class = Doctrine\ORM\Mapping\Driver\XmlDriver
resources.doctrine.driver.dir = APPLICATION_PATH "/../library/Droop/Model/Xml"
resources.doctrine.cache.class = Doctrine\Common\Cache\ArrayCache
resources.doctrine.conn.driver = pdo_mysql
= Models hierarchy =
class Sysbase {}
class Drooplet extends Sysbase {}
class Menu extends Sysbase {}
= Xml driver =
attached
= Error =
While using command line to generate schema [php doctrine.php orm:schema-tool:create --dump-sql], it reports error "The table with name 'system' already exists." on windows however not on linux.
It is because the ClassMetaFactory.php depends on the sequence of result returned by getAllClassNames(). In this scenario, it's in descending order on linux and ascending on windows.
124 foreach ($this->driver->getAllClassNames() as $className)
127
128 return $metadata;
This order populates to SchemaTool::getSchemaFromMetadata(); If the base model is processed before it's descendants, everything is OK. Otherwise, it will complain about the table already exists.
= Fix =
ClassMetaFactory.php
128 return $this->loadedMetadata;
By what means is that a valid fix? Doesnt that just give another random order that happens to work for your cases now?