propelorm / PropelBundle

PropelBundle for Symfony.
http://propelorm.org/Propel/documentation/#working-with-symfony2
180 stars 156 forks source link

Unable to use foreign keys across schemas #498

Closed richmulhern closed 1 year ago

richmulhern commented 5 years ago

I'm trying to use Symfony 3.4 with Propel 2 and PropelBundle 4.0. When trying to run the model:build command with foreign keys across different schemas it fails to generate the models. I have a simple schema like this:

web-schema.xml

<database name="webcore" defaultIdMethod="native">
  <table name="CLIENT_SECTION">
    <column name="CLIENT_NO" type="NUMERIC" size="22" primaryKey="true" />
    <column name="SECTION_ID" type="NUMERIC" size="22" primaryKey="true" />
    <foreign-key foreignTable="DASHBOARD_CLIENT">
      <reference local="CLIENT_NO" foreign="CLIENT_NO" />
    </foreign-key>
  </table>
  <table name="DASHBOARD_CLIENT">
    <column name="CLIENT_NO" type="NUMERIC" size="22" primaryKey="true" />
    <foreign-key foreignTable="CLIENT">
      <reference local="CLIENT_NO" foreign="CLIENT_NO" />
    </foreign-key>
  </table>
</database>

core-schema.xml

<database name="ariacore" defaultIdMethod="native">
  <table name="CLIENT">
    <column name="CLIENT_NO" type="NUMERIC" size="22" primaryKey="true" autoIncrement="true" />
    <id-method-parameter value="CLIENT_NO_SEQ" />
    <column name="CLIENT_NAME" type="VARCHAR" size="100" primaryString="true" />
  </table>
</database>

When I try to run the model:build command using propel model:build --platform oracle --config-dir app/config --schema-dir src/AppBundle/Resources/ --output-dir src/AppBundle/Model --composer-dir . -vvv

My output is just the following.


Processing: core-schema.xml
  1 tables processed successfully
Processing: web-schema.xml
  3 tables processed successfully
4 tables found in 2 schema files.```

And no files are generated. If I remove the foreign key from DASHBOARD_CLIENT to CLIENT, it will generate all the model files.
dereuromark commented 1 year ago

All further dev and tickets should go into https://github.com/SkyFoxvn/PropelBundle as this will most likely be the follower of this now.