[answered] Foreign schema attribute

0 votes
asked Feb 17, 2015 in Solved by d.deboer-axtion (210 points)
recategorized Mar 19, 2015 by ludek.vodicka

When creating multi-schema postgresql model using Skipper 3.0.1.1129 am I able to set the foreignSchema attribute on a "simple"-association. Although, when I wish to fill out that attribute on a M:M-association, it's not available, eventhough Propel does support it.

My project configuration:

Symfony2, Propel, export to xml

commented Feb 17, 2015 by d.deboer-axtion (210 points)

temporary single-machine workaround -> edit "Propel.skipper.cfg" and add the attribute manually

commented Feb 17, 2015 by ludek.vodicka Skipper developer (140,450 points)

Hi, can you please send me link to documentation where this attribute is described? It's not problem to add it but we would like to make sure that we don't miss anything. Thanks

commented Feb 20, 2015 by d.deboer-axtion (210 points)

I couldn't find the specific page you requested. I tried some things in the plain propel schema to resolve an error I stumbled upon while building. Finally this resulted in the given work-around, which seems to me, to be a good adjustment of the installed version.

commented Feb 20, 2015 by ludek.vodicka Skipper developer (140,450 points)

ok, I understand. Can you paste here which modifications you made and we will integrate it to distributed configuration files?

commented Feb 20, 2015 by d.deboer-axtion (210 points)

Propel.skipper.cfg.xml

        <struct name="ManyToManyEntity" section="orm" help-text="" help-url="http://propelorm.org/documentation/04-relationships.html">
            <attribute name="onDelete" type="enum" enum-values="CASCADE|RESTRICT|SETNULL" help-text="Trigger event." help-url="http://propelorm.org/documentation/04-relationships.html#on-update-and-on-delete-triggers" />
            <attribute name="onUpdate" type="enum" enum-values="CASCADE|RESTRICT|SETNULL" help-text="Trigger event." help-url="http://propelorm.org/documentation/04-relationships.html#on-update-and-on-delete-triggers" />
            <attribute name="phpName" type="string" help-text="" />
            <attribute name="refPhpName" type="string"  help-text="" />
            <attribute name="skipSql" type="bool" help-text="Instructs Propel not to generate DDL SQL for the specified foreign key. This can be used to support relationships in the model without an actual foreign key."  />
            <attribute name="defaultJoin" type="enum" enum-values="Criteria::INNER_JOIN|Criteria::LEFT_JOIN" help-text="This affects the default join type used in the generated joinXXX() methods in the model query class." />
            <!-- ADDED--><attribute name="foreignSchema" type="string" help-text="If association is between database schemas, add the schema name here."/>
        </struct>
commented Feb 20, 2015 by ludek.vodicka Skipper developer (140,450 points)

Thanks. We will add it to next release

commented Feb 20, 2015 by d.deboer-axtion (210 points)

Thanks!

1 Answer

0 votes
answered Feb 20, 2015 by d.deboer-axtion (210 points)

Propel.skipper.cfg.xml

    <struct name="ManyToManyEntity" section="orm" help-text="" help-url="http://propelorm.org/documentation/04-relationships.html">
        <attribute name="onDelete" type="enum" enum-values="CASCADE|RESTRICT|SETNULL" help-text="Trigger event." help-url="http://propelorm.org/documentation/04-relationships.html#on-update-and-on-delete-triggers" />
        <attribute name="onUpdate" type="enum" enum-values="CASCADE|RESTRICT|SETNULL" help-text="Trigger event." help-url="http://propelorm.org/documentation/04-relationships.html#on-update-and-on-delete-triggers" />
        <attribute name="phpName" type="string" help-text="" />
        <attribute name="refPhpName" type="string"  help-text="" />
        <attribute name="skipSql" type="bool" help-text="Instructs Propel not to generate DDL SQL for the specified foreign key. This can be used to support relationships in the model without an actual foreign key."  />
        <attribute name="defaultJoin" type="enum" enum-values="Criteria::INNER_JOIN|Criteria::LEFT_JOIN" help-text="This affects the default join type used in the generated joinXXX() methods in the model query class." />
        <!-- ADDED--><attribute name="foreignSchema" type="string" help-text="If association is between database schemas, add the schema name here."/>
    </struct>
...