Login | Register
My pages Projects Community openCollabNet

Discussions > users > [propel] External schema and generator problem

propel
Discussion topic

Back to topic list

[propel] External schema and generator problem

Reply

Author Antony ZANETTI <az at hyliosoft dot com>
Full name Antony ZANETTI <az at hyliosoft dot com>
Date 2005-03-02 00:24:39 PST
Message Hi everyone,

I've a problem when I generate classes and sql files. I don't know if it
is a bug or the behaviour of Propel.

I did a test app which reproduce it. I'm using the latest Creole/Propel
CVS source code.

So, I define 3 schema files:
- a-schema.xml
- b-schema.xml
- c-schema.xml

Then 6 tables, 6 classes, and 3 packages:
- table1 (MyPackages.Package1.Class1), table2
(MyPackages.Package1.Class2) in a-schema

- table3 (MyPackages.Package2.Class3), table4 (MyPackages.Package2.Class4)

- table5 (MyPackages.Package3.Class5), table6 (MyPackages.Package3.Class6)

Defined foreign keys:
- table3 has a foreign key from table1
- table5 has a foreign key from table1 and table3

After building the application:
- 3 directories for each package are created (OK) : MyPackages/Package1,
MyPackages/Package2 and MyPackages/Package3

In MyPackages/Package1:
- Class1 and Class2 related files are created (OK)

In MyPackages/Package2:
- Class3 and Class4 related files are created (OK)

In MyPackages/Package3:
- Class3, Class4, Class5, Class6 related files are created (NOT OK)

Here is the problem Class3 and Class4 files are created in Package3 and
I think they shouldn't because they are in Package2.

The generated sql files reproduce the same behaviour table3, table4,
table5 and table6 are created in c-schema.sql but only table5 and table6
should be within.

File Samples:
-------------

a-schema.xml:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<database name="testpropel" defaultIdMethod="native"
package="MyPackages.​Package1">
    
    <table name="table1" phpName="Class1">
        <column name="t1_f1" required="true" primaryKey="true" type="INTEGER"
autoIncrement="true" />
        <column name="t1_f2" required="true" type="VARCHAR" size="75" />
    </table>

    <table name="table2" phpName="Class2">
        <column name="t2_f1" required="true" primaryKey="true" type="INTEGER"
autoIncrement="true" />
        <column name="t2_f2" required="true" type="VARCHAR" size="75" />
    </table>

</database>

b-schema.xml:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<database name="testpropel" defaultIdMethod="native"
package="MyPackages.​Package2">
    
    <external-schema filename="a-schema.xml"/>

    <table name="table3" phpName="Class3">
        <column name="t3_f1" required="true" primaryKey="true" type="INTEGER"
autoIncrement="true" />
        <column name="t3_f2" required="true" type="VARCHAR" size="75" />
        <column name="t1_f1" required="true" type="INTEGER" />
        <foreign-key foreignTable="table1">
            <reference local="t1_f1" foreign="t1_f1"/>
        </foreign-key>
    </table>

    <table name="table4" phpName="Class4">
        <column name="t4_f1" required="true" primaryKey="true" type="INTEGER"
autoIncrement="true" />
        <column name="t4_f2" required="true" type="VARCHAR" size="75" />
    </table>

</database>

c-schema.xml:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<database name="testpropel" defaultIdMethod="native"
package="MyPackages.​Package3">
    
    <external-schema filename="a-schema.xml"/>
    <external-schema filename="b-schema.xml"/>

    <table name="table5" phpName="Class5">
        <column name="t5_f1" required="true" primaryKey="true" type="INTEGER"
autoIncrement="true" />
        <column name="t5_f2" required="true" type="VARCHAR" size="75" />
        <column name="t1_f1" required="true" type="INTEGER" />
        <column name="t3_f1" required="true" type="INTEGER" />
        <foreign-key foreignTable="table1">
            <reference local="t1_f1" foreign="t1_f1"/>
        </foreign-key>
        <foreign-key foreignTable="table3">
            <reference local="t3_f1" foreign="t3_f1"/>
        </foreign-key>
    </table>

    <table name="table6" phpName="Class6">
        <column name="t6_f1" required="true" primaryKey="true" type="INTEGER"
autoIncrement="true" />
        <column name="t6_f2" required="true" type="VARCHAR" size="75" />
    </table>

</database>

--

Thanks!

Antony ZANETTI


--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: users-unsubscribe@pr​opel.tigris.org
For additional commands, e-mail: users-help at propel dot tigris dot org

« Previous message in topic | 1 of 19 | Next message in topic »

Messages

Show all messages in topic

[propel] External schema and generator problem Antony ZANETTI <az at hyliosoft dot com> Antony ZANETTI <az at hyliosoft dot com> 2005-03-02 00:24:39 PST
     Re: [propel] External schema and generator problem pachanga Pavel Chtchevaev 2005-03-02 00:46:51 PST
         Re: [propel] External schema and generator problem Antony ZANETTI <az at hyliosoft dot com> Antony ZANETTI <az at hyliosoft dot com> 2005-03-09 05:42:39 PST
             Re[2]: [propel] External schema and generator problem pachanga Pavel Chtchevaev 2005-03-10 00:42:54 PST
                 Re: [propel] External schema and generator problem Antony ZANETTI <az at hyliosoft dot com> Antony ZANETTI <az at hyliosoft dot com> 2005-03-10 01:21:46 PST
                     Re[2]: [propel] External schema and generator problem pachanga Pavel Chtchevaev 2005-03-10 01:28:00 PST
                         Re: [propel] External schema and generator problem Antony ZANETTI <az at hyliosoft dot com> Antony ZANETTI <az at hyliosoft dot com> 2005-03-10 01:40:59 PST
                             Re[2]: [propel] External schema and generator problem pachanga Pavel Chtchevaev 2005-03-10 01:50:18 PST
                                 Re: [propel] External schema and generator problem Antony ZANETTI <az at hyliosoft dot com> Antony ZANETTI <az at hyliosoft dot com> 2005-03-10 01:59:09 PST
                                     Re[2]: [propel] External schema and generator problem pachanga Pavel Chtchevaev 2005-03-10 02:24:11 PST
                                         Re: [propel] External schema and generator problem Antony ZANETTI <az at hyliosoft dot com> Antony ZANETTI <az at hyliosoft dot com> 2005-03-10 02:33:15 PST
                                             Re[2]: [propel] External schema and generator problem pachanga Pavel Chtchevaev 2005-03-10 03:26:25 PST
                                                 Re: [propel] External schema and generator problem Antony ZANETTI <az at hyliosoft dot com> Antony ZANETTI <az at hyliosoft dot com> 2005-03-10 08:34:20 PST
                                             Re: [propel] External schema and generator problem hlellelid Hans Lellelid 2005-03-10 05:24:31 PST
                                                 Re: [propel] External schema and generator problem Antony ZANETTI <az at hyliosoft dot com> Antony ZANETTI <az at hyliosoft dot com> 2005-03-10 08:37:49 PST
                                                     Re: [propel] External schema and generator problem Jeff Lindsay <progrium at gmail dot com> Jeff Lindsay <progrium at gmail dot com> 2005-04-05 12:27:32 PDT
                                                         Re: [propel] External schema and generator problem hlellelid Hans Lellelid 2005-04-06 09:45:13 PDT
                                                         RE: [propel] External schema and generator problem cyruzb Bert Van den Brande 2005-04-06 13:49:49 PDT
                                                             Re: [propel] External schema and generator problem hlellelid Hans Lellelid 2005-04-06 16:12:23 PDT
Messages per page: