0 votes

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

in Solved by (210 points)
recategorized by

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

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

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.

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

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>

Thanks. We will add it to next release

Thanks!

1 Answer

0 votes

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>
by (210 points)