You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Colm McCartan <co...@owl.co.uk> on 2001/12/19 17:28:20 UTC

PostgreSQL and extending turbine_user

Hello all,

I have sucessfully followed the Extend-User Howto to allow me to make 
foreign-key references to the turbine_user table in MySQL. However, 
moving this schema to postgreSQL has revealed that this process 
generates faulty DDL - I assume MySQL doesn't mind because it doesn't 
support foreign keys anyway...

When PostgreSQl encounters a foreign key referencing, for instance, 
table MyAppUser (an extension/alias of turbine_user), it correctly 
points out that this relation does not exist. Am I right in thinking 
that this reference should be to the underlying turbine_user table since 
the MyAppUser table only 'exists' at the xml level so that torque can 
generate appropriate peers classes and code?

If this is the case then I would be willing to have a go at patching the 
torque code if someone wants to help me with a few pointers as to where 
to start.

Cheers,
colm


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: PostgreSQL and extending turbine_user

Posted by Scott Eade <se...@backstagetech.com.au>.
From: "Colm McCartan" <co...@owl.co.uk>
> I have sucessfully followed the Extend-User Howto to allow me to make
> foreign-key references to the turbine_user table in MySQL. However,
> moving this schema to postgreSQL has revealed that this process
> generates faulty DDL - I assume MySQL doesn't mind because it doesn't
> support foreign keys anyway...
>
> When PostgreSQl encounters a foreign key referencing, for instance,
> table MyAppUser (an extension/alias of turbine_user), it correctly
> points out that this relation does not exist. Am I right in thinking
> that this reference should be to the underlying turbine_user table since
> the MyAppUser table only 'exists' at the xml level so that torque can
> generate appropriate peers classes and code?

I think you are right.  I have just looked at the generated schema for my
application which currently uses MySQL and I agree that the generated
foreign key relationships should refer to TURBINE_USER.

> If this is the case then I would be willing to have a go at patching the
> torque code if someone wants to help me with a few pointers as to where
> to start.

Are you using turbine 2.1 or stand alone torque?  You should probably
patch torque and then backport to 2.1 if that is what you are using.

Steps are:
1. Check out the code from CVS
2. Make any necessary changes
3. Test to make sure your change works
4. Submit a patch in the appropriate format to the turbine-dev list (details
are on the turbine site somewhere).

I believe there is a test suite for standalone torque that I think you need
to
be able to execute successfully for your patch to be accepted.  I haven't
looked into this yet, but you should find details in the turbine-dev mail
archive.

Incidentally, I have revisited the problem highlighted at the bottom of the
extend-user-howto and have a hack to Object.vm that makes everything
work.  I'll probably update the howto with details of this rather than
patching as it still seems like a bit of a hack and it is only a small
change.
This is working successfully for me in a production environment and it
makes things a whole lot easier than the workaround.  If you are interested
I can post details of the change today.

Cheers,

Scott



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>