You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by phillip rhodes <rh...@telerama.com> on 2002/09/09 04:55:25 UTC

turbine id table, manipulating?

Hi.
Sometimes I make a change to my data model and re-run init to recreate the database, etc.
I then write a custom program to migrate the data from the old db to the new db.

The problem is that id table values are set to "100", and I need to set them to max(+1) of their corresponding values, that is, if it's used for the order table, I have to get the max order_id from this table, and set the id_table.

Has anyone come up with some tricks?  Is the id table able to be manipulated via torque?
Using tdk 2.1

Thanks!


Re: turbine id table, manipulating?

Posted by Daniel Craigen <da...@8stanleypark.co.uk>.
Hi,

I have modified my idtable.mysql velocity template to do just this.
You can find it at WEB-INF\build\bin\torque\templates\sql\id-table
It works for mysql, but haven't tried it for anything else.

If anyone has any modifications feel free to improve.

ta,
Dan

----- Original Message -----
From: "Scott Eade" <se...@backstagetech.com.au>
To: "turbine-user" <tu...@jakarta.apache.org>
Sent: Monday, September 09, 2002 4:17 AM
Subject: Re: turbine id table, manipulating?


> > From: "phillip rhodes" <rh...@telerama.com>
> >
> > Hi.
> > Sometimes I make a change to my data model and re-run init to recreate
the
> > database, etc.
> > I then write a custom program to migrate the data from the old db to the
new
> > db.
> >
> > The problem is that id table values are set to "100", and I need to set
them
> > to max(+1) of their corresponding values, that is, if it's used for the
order
> > table, I have to get the max order_id from this table, and set the
id_table.
> >
> > Has anyone come up with some tricks?  Is the id table able to be
manipulated
> > via torque?
> > Using tdk 2.1
>
> I know there is an answer to this somewhere in the mail list archive.
>
> Cheers,
>
> Scott
> --
> Scott Eade
> Backstage Technologies Pty. Ltd.
> http://www.backstagetech.com.au
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>

Re: turbine id table, manipulating?

Posted by Scott Eade <se...@backstagetech.com.au>.
> From: "phillip rhodes" <rh...@telerama.com>
> 
> Hi.
> Sometimes I make a change to my data model and re-run init to recreate the
> database, etc.
> I then write a custom program to migrate the data from the old db to the new
> db.
> 
> The problem is that id table values are set to "100", and I need to set them
> to max(+1) of their corresponding values, that is, if it's used for the order
> table, I have to get the max order_id from this table, and set the id_table.
> 
> Has anyone come up with some tricks?  Is the id table able to be manipulated
> via torque?
> Using tdk 2.1

I know there is an answer to this somewhere in the mail list archive.

Cheers,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au



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