ForeignKey between 2 schemas, 1 with prefix one without prefix, tries to link to wrongly prefixed table #630

Open
stijnr opened this Issue Mar 13, 2013 · 0 comments

Projects

None yet

1 participant

@stijnr
stijnr commented Mar 13, 2013

Here are my 2 schemas:

general.schema.xml

<database name="default" namespace="My\CoreBundle\Model" defaultIdMethod="native" schema="general">
    <table name="institution">
      <column name="id" type="INTEGER" primaryKey="true" autoIncrement="true" />
      <column name="name" type="VARCHAR" size="255" primaryString="true" required="true" />
    </table>
</database>

dko.schema.xml

<database name="default" namespace="Oim\CoreBundle\DKO" defaultIdMethod="native" tablePrefix="dko_" schema="dko" >
    <table name="admin_group">
      <column name="id"                       type="INTEGER" primaryKey="true" autoIncrement="true" />
      <column name="institution_id"           type="INTEGER" required="true" />
      <foreign-key foreignTable="institution" foreignSchema="general">
        <reference local="institution_id" foreign="id" />
      </foreign-key>
    </table>
</database>

And the error:
Table "dko_admin_group" contains a foreign key to nonexistent table "general.dko_institution"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment