Devender | 1 Jan 2007 15:36
Favicon

composite primary key


I want to create composite primary key in propel. but i am not getting how to
create. can any one help me ?

thanx in advance. 
--

-- 
View this message in context: http://www.nabble.com/composite-primary-key-tf2904299.html#a8113922
Sent from the propel - users mailing list archive at Nabble.com.
≈ Umujäx ≈ | 1 Jan 2007 15:42
Picon

Re: composite primary key

i read about creation composite primary keys at symfony fraemwork project forums. i think you can check there.

On 1/1/07, Devender < devender.dagar <at> otssolutions.com> wrote:

I want to create composite primary key in propel. but i am not getting how to
create. can any one help me ?

thanx in advance.
--
View this message in context: http://www.nabble.com/composite-primary-key-tf2904299.html#a8113922
Sent from the propel - users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe <at> propel.tigris.org
For additional commands, e-mail: users-help <at> propel.tigris.org




--
Regards,
Umut AYDIN
Senior Software Developer

CE Bilgi Islem ve Guvenlik Sistemleri Ltd.Sti.
Buyukdere cad. USO Center No:61 Kat:17
Maslak, Sisli 34398 Istanbul, Turkey
Tel : +90 212 330-0450
Fax : +90 212 330-0460

www.cetech.biz
info <at> cetech.biz
umut <at> cetech.biz
Hans Lellelid | 1 Jan 2007 16:32

Re: composite primary key

Hi -

Devender wrote:
> I want to create composite primary key in propel. but i am not getting how to
> create. can any one help me ?
> 

Yes, just specify primaryKey="true" on multiple columns, e.g.:

<column name="some_col" type="integer" primaryKey="true"/>
<column name="other_col" type="integer" primaryKey="true"/>

(Happy new year!)

Hans
Martin Groh | 2 Jan 2007 15:59
Picon

self referencing an object...

Hi there!

I have a table that contains glossary entries (fields: "term", "synonym" 
and "description").
The field "synonym" should only contain the id of the "term" that has a 
synonyminal description.

Example:
tableentry1: term=motherboard, description="a motherboard is a...", 
synonym=empty
tableentry2: term=mainboard, description=empty, synonym=id of entry1

what I need is a select list that contains all terms, so that I can 
choose one (if it is a synonym) an store that id in the synonym field.

I hope that is clear enough (as I write this i realize, I even have 
problems describing the problem...)

Has anybody got an idea of how to handle this with symfony? Is there 
support for this?

Thanks a lot and a happy 2007 from
Greenhorn Martin
Martin Groh | 2 Jan 2007 16:00
Picon

Re: self referencing an object...

sorry! wrong mailing list!!! oops...

Martin Groh schrieb:
> Hi there!
>
> I have a table that contains glossary entries (fields: "term", 
> "synonym" and "description").
> The field "synonym" should only contain the id of the "term" that has 
> a synonyminal description.
>
> Example:
> tableentry1: term=motherboard, description="a motherboard is a...", 
> synonym=empty
> tableentry2: term=mainboard, description=empty, synonym=id of entry1
>
> what I need is a select list that contains all terms, so that I can 
> choose one (if it is a synonym) an store that id in the synonym field.
>
> I hope that is clear enough (as I write this i realize, I even have 
> problems describing the problem...)
>
> Has anybody got an idea of how to handle this with symfony? Is there 
> support for this?
>
> Thanks a lot and a happy 2007 from
> Greenhorn Martin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe <at> propel.tigris.org
> For additional commands, e-mail: users-help <at> propel.tigris.org
>
>
Stefan Leenen | 3 Jan 2007 14:57

break BC if your object model uses one-to-one relationships

Hi people,

first of all, HAPPY NEW YEAR!

I'm just trying out 1.3 trunk and I get some problems with the 
one-on-one relations. I have the following two tables (see below).

This will now give me an error '*Fatal error*: Cannot redeclare 
BasePerson::$aUser in *propel/classes/om/BasePerson.php* on line *209'

*This has to do with the fact that owner_user_id also points to the User 
table I guess... How would I fix this problem?

greets,

Stefan

<table name="persons" phpName="Person" description="Person module data">
        <column name="id"
                type="INTEGER"
                primaryKey="true"
                autoIncrement="true"
                description="" />

        <column name="firstname"
                type="VARCHAR"
                size="255"
                required="true"
                description="" />

        <column name="lastname"
                type="VARCHAR"
                size="255"
                required="true"
                description="" />

        <column name="owner_user_id"
                type="INTEGER"
                description="" />

        <foreign-key foreignTable="users" onDelete="setnull" 
onUpdate="cascade">
            <reference local="owner_user_id" foreign="person_id" />
        </foreign-key>
    </table>

    <table name="users" phpName="User" description="User accounts">
        <column name="person_id"
                type="INTEGER"
                primaryKey="true"     
                description="" />

        <column name="username"
                type="VARCHAR"
                size="255"
                required="true"
                description="" />

        <foreign-key foreignTable="persons" onDelete="cascade" 
onUpdate="cascade">
            <reference local="person_id" foreign="id"/>
        </foreign-key>
    </table>
Hans Lellelid | 3 Jan 2007 15:00

Re: break BC if your object model uses one-to-one relationships

Hi Stefan,

Thanks for the heads-up!  I'll try to look into this (& hopefully fix
it) later today.  It may be as simple as just declaring a new var name
for the special-case one-to-one relationship.

Hans

Stefan Leenen wrote:
> Hi people,
> 
> first of all, HAPPY NEW YEAR!
> 
> I'm just trying out 1.3 trunk and I get some problems with the
> one-on-one relations. I have the following two tables (see below).
> 
> This will now give me an error '*Fatal error*: Cannot redeclare
> BasePerson::$aUser in *propel/classes/om/BasePerson.php* on line *209'
> 
> *This has to do with the fact that owner_user_id also points to the User
> table I guess... How would I fix this problem?
> 
> greets,
> 
> Stefan
> 
> <table name="persons" phpName="Person" description="Person module data">
>        <column name="id"
>                type="INTEGER"
>                primaryKey="true"
>                autoIncrement="true"
>                description="" />
> 
>        <column name="firstname"
>                type="VARCHAR"
>                size="255"
>                required="true"
>                description="" />
> 
>        <column name="lastname"
>                type="VARCHAR"
>                size="255"
>                required="true"
>                description="" />
> 
>        <column name="owner_user_id"
>                type="INTEGER"
>                description="" />
> 
>        <foreign-key foreignTable="users" onDelete="setnull"
> onUpdate="cascade">
>            <reference local="owner_user_id" foreign="person_id" />
>        </foreign-key>
>    </table>
> 
>    <table name="users" phpName="User" description="User accounts">
>        <column name="person_id"
>                type="INTEGER"
>                primaryKey="true"                    description="" />
> 
>        <column name="username"
>                type="VARCHAR"
>                size="255"
>                required="true"
>                description="" />
> 
>        <foreign-key foreignTable="persons" onDelete="cascade"
> onUpdate="cascade">
>            <reference local="person_id" foreign="id"/>
>        </foreign-key>
>    </table>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe <at> propel.tigris.org
> For additional commands, e-mail: users-help <at> propel.tigris.org
> 
Even André Fiskvik | 3 Jan 2007 15:02
Picon

Re: [propel-dev] Problems with package support...

It seems that the issue is not related to the "Packages" in any way, having relations between tables that are defined in different schemas seems to be broken alltogether?

Best regards,
Even André

Even André Fiskvik wrote:
I've tried the bookstore-packaged examples, and I have the same problem there as I have in my own project.
When trying to reference a table in another package, propel (both version 1.2 and 1.3) will fail at doing so.

Result from propel-gen run on the bookstore-packaged project example:
[propel-convert-conf] Processing: book.schema.xml
[propel-convert-conf] Processing: book_club_list.schema.xml
[propel-convert-conf] Processing: media.schema.xml
[propel-convert-conf] Processing: publisher.schema.xml
[propel-convert-conf] Processing: log.schema.xml
[propel-convert-conf] Processing: review.schema.xml
[propel-convert-conf] Processing: author.schema.xml
Execution of target "convert-conf" failed for the following reason: /usr/local/lib/php/data/propel_generator/build-propel.xml:458:12: ERROR!! Attempt to set foreign key to nonexistent table, publisher!
[phingcall] /usr/local/lib/php/data/propel_generator/build-propel.xml:458:12: ERROR!! Attempt to set foreign key to nonexistent table, publisher!

Is this functionality broken?

Best regards,
Even André Fiskvik

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe <at> propel.tigris.org
For additional commands, e-mail: dev-help <at> propel.tigris.org

Stefan Leenen | 3 Jan 2007 15:03

Re: break BC if your object model uses one-to-one relationships

That would most likely be enough yes.

I'll watch the svn commits :)

gr,

Stefan

Hans Lellelid wrote:
> Hi Stefan,
> 
> Thanks for the heads-up!  I'll try to look into this (& hopefully fix
> it) later today.  It may be as simple as just declaring a new var name
> for the special-case one-to-one relationship.
> 
> Hans
> 
> Stefan Leenen wrote:
>> Hi people,
>>
>> first of all, HAPPY NEW YEAR!
>>
>> I'm just trying out 1.3 trunk and I get some problems with the
>> one-on-one relations. I have the following two tables (see below).
>>
>> This will now give me an error '*Fatal error*: Cannot redeclare
>> BasePerson::$aUser in *propel/classes/om/BasePerson.php* on line *209'
>>
>> *This has to do with the fact that owner_user_id also points to the User
>> table I guess... How would I fix this problem?
>>
>> greets,
>>
>> Stefan
>>
>> <table name="persons" phpName="Person" description="Person module data">
>>        <column name="id"
>>                type="INTEGER"
>>                primaryKey="true"
>>                autoIncrement="true"
>>                description="" />
>>
>>        <column name="firstname"
>>                type="VARCHAR"
>>                size="255"
>>                required="true"
>>                description="" />
>>
>>        <column name="lastname"
>>                type="VARCHAR"
>>                size="255"
>>                required="true"
>>                description="" />
>>
>>        <column name="owner_user_id"
>>                type="INTEGER"
>>                description="" />
>>
>>        <foreign-key foreignTable="users" onDelete="setnull"
>> onUpdate="cascade">
>>            <reference local="owner_user_id" foreign="person_id" />
>>        </foreign-key>
>>    </table>
>>
>>    <table name="users" phpName="User" description="User accounts">
>>        <column name="person_id"
>>                type="INTEGER"
>>                primaryKey="true"                    description="" />
>>
>>        <column name="username"
>>                type="VARCHAR"
>>                size="255"
>>                required="true"
>>                description="" />
>>
>>        <foreign-key foreignTable="persons" onDelete="cascade"
>> onUpdate="cascade">
>>            <reference local="person_id" foreign="id"/>
>>        </foreign-key>
>>    </table>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe <at> propel.tigris.org
>> For additional commands, e-mail: users-help <at> propel.tigris.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe <at> propel.tigris.org
> For additional commands, e-mail: users-help <at> propel.tigris.org
> 
> 
Stefan Leenen | 3 Jan 2007 16:36

Re: break BC if your object model uses one-to-one relationships

ok, that was in the trunk... in the 1.3 branch it also fails though:

Fatal error: Cannot redeclare BasePerson::getUser()

so thats something similar (same table structure)

gr

Stefan

Stefan Leenen wrote:
> Hi people,
> 
> first of all, HAPPY NEW YEAR!
> 
> I'm just trying out 1.3 trunk and I get some problems with the 
> one-on-one relations. I have the following two tables (see below).
> 
> This will now give me an error '*Fatal error*: Cannot redeclare 
> BasePerson::$aUser in *propel/classes/om/BasePerson.php* on line *209'
> 
> *This has to do with the fact that owner_user_id also points to the User 
> table I guess... How would I fix this problem?
> 
> greets,
> 
> Stefan
> 
> <table name="persons" phpName="Person" description="Person module data">
>        <column name="id"
>                type="INTEGER"
>                primaryKey="true"
>                autoIncrement="true"
>                description="" />
> 
>        <column name="firstname"
>                type="VARCHAR"
>                size="255"
>                required="true"
>                description="" />
> 
>        <column name="lastname"
>                type="VARCHAR"
>                size="255"
>                required="true"
>                description="" />
> 
>        <column name="owner_user_id"
>                type="INTEGER"
>                description="" />
> 
>        <foreign-key foreignTable="users" onDelete="setnull" 
> onUpdate="cascade">
>            <reference local="owner_user_id" foreign="person_id" />
>        </foreign-key>
>    </table>
> 
>    <table name="users" phpName="User" description="User accounts">
>        <column name="person_id"
>                type="INTEGER"
>                primaryKey="true"                    description="" />
> 
>        <column name="username"
>                type="VARCHAR"
>                size="255"
>                required="true"
>                description="" />
> 
>        <foreign-key foreignTable="persons" onDelete="cascade" 
> onUpdate="cascade">
>            <reference local="person_id" foreign="id"/>
>        </foreign-key>
>    </table>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe <at> propel.tigris.org
> For additional commands, e-mail: users-help <at> propel.tigris.org
> 
> 

Gmane