You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Sven Haiges <sh...@flavor.de> on 2003/11/10 21:54:36 UTC

How to migrate to a new db structure.

Hi there.

I have Torque 1.1 running and everything works great now. Dev got a lot 
easier.

My only trouble is: what happens if I have to change the structure, because 
my client wants some additional data to be saved in the DB? Once, I tried 
to copy my local version of both the WebApp (class files)  + exact Copy of 
the DB to the server, but then torque refused to create new objects - 
everything else: delete and read worked great.

This seemed to have something to do with the id_table, but: I don't 
understand why it does not work, because I got the exact copy of teh 
id_table locally and remotely.

---

What happens if i create my OM class files again with torque generator? is 
there somewhere a unique key added, that then differentiates each version 
of the generated files?

---

thanx,
sven


RE: How to migrate to a new db structure.

Posted by Sven Haiges <sh...@flavor.de>.
thank you.

regarding the frist question: yes,it is an mysql. i basically began 
developing on a local winXP system and then uploaded the application. i 
used phpMyAdmin to get a database-dump and created the exact same state on 
the server. but on the server, i could only delete and change records. 
torque refuses to add new ones.

is this a known problem? i got problems understanding that, because the 
webapp is 100% the same and the database should also be the same. The 
Id-table reflects the current state of the saved objects, so i did not 
erroneously reset it. but still it seems to be a problem with the 
id_table... any ideas?

cu
sven

At 04:40 PM 10/11/2003 -0800, you wrote:

> > so: 1. Why can't I just copy the database and the web-app to my
>server?
> > Why
> > can i read and change, but not add new entries with the Torque om
>models?
>
>What is the database MySql?  Can you insert records in the local
>database and not in the remote one?
>
> > 2. how would i add some more features to my objects, and migrate all
>the
> > data to the new tables in an easy way?
>
>The process is similar to when you first generated Java files from
>torque, except that you only copy Basexxx.java over to your development
>directory:
>
>1.  Make sure the xxx-schema.xml is up-to-date and reflects changes to
>the database structure,
>2.  regenerate torque src files
>3.  copy only the Basexxx.java files over to the torque development
>directory
>
>Hope it helps.  Let me know if you need additional info.
>
>
> > thanx!
> > sven
> >
> > At 02:15 PM 10/11/2003 -0800, you wrote:
> >
> > >I see two different questions, (1) you're planning to modify db
> > >structure, and (2) your app works locally but not on the remote
>server.
> > >Are these questions related?
> > >
> > > > -----Original Message-----
> > > > From: Sven Haiges [mailto:sh@flavor.de]
> > > > Sent: Monday, November 10, 2003 12:55 PM
> > > > To: torque-user@db.apache.org
> > > > Subject: How to migrate to a new db structure.
> > > >
> > > > Hi there.
> > > >
> > > > I have Torque 1.1 running and everything works great now. Dev got
>a
> > >lot
> > > > easier.
> > > >
> > > > My only trouble is: what happens if I have to change the
>structure,
> > > > because
> > > > my client wants some additional data to be saved in the DB? Once,
>I
> > >tried
> > > > to copy my local version of both the WebApp (class files)  + exact
> > >Copy of
> > > > the DB to the server, but then torque refused to create new
>objects -
> > > > everything else: delete and read worked great.
> > > >
> > > > This seemed to have something to do with the id_table, but: I
>don't
> > > > understand why it does not work, because I got the exact copy of
>teh
> > > > id_table locally and remotely.
> > > >
> > > > ---
> > > >
> > > > What happens if i create my OM class files again with torque
> > >generator? is
> > > > there somewhere a unique key added, that then differentiates each
> > >version
> > > > of the generated files?
> > > >
> > > > ---
> > > >
> > > > thanx,
> > > > sven
> > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > >For additional commands, e-mail: torque-user-help@db.apache.org
> >
> >
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-user-help@db.apache.org


---
Sven Haiges
sh@flavor.de
http://www.svenhaiges.de

Author of:
Struts - Java Framework f�r Webanwendungen
ISBN: 3935042-37-X


RE: How to migrate to a new db structure.

Posted by Ramesh Sabeti <rs...@reazon.com>.
> so: 1. Why can't I just copy the database and the web-app to my
server?
> Why
> can i read and change, but not add new entries with the Torque om
models?

What is the database MySql?  Can you insert records in the local
database and not in the remote one?

> 2. how would i add some more features to my objects, and migrate all
the
> data to the new tables in an easy way?

The process is similar to when you first generated Java files from
torque, except that you only copy Basexxx.java over to your development
directory:

1.  Make sure the xxx-schema.xml is up-to-date and reflects changes to
the database structure, 
2.  regenerate torque src files 
3.  copy only the Basexxx.java files over to the torque development
directory

Hope it helps.  Let me know if you need additional info.

 
> thanx!
> sven
> 
> At 02:15 PM 10/11/2003 -0800, you wrote:
> 
> >I see two different questions, (1) you're planning to modify db
> >structure, and (2) your app works locally but not on the remote
server.
> >Are these questions related?
> >
> > > -----Original Message-----
> > > From: Sven Haiges [mailto:sh@flavor.de]
> > > Sent: Monday, November 10, 2003 12:55 PM
> > > To: torque-user@db.apache.org
> > > Subject: How to migrate to a new db structure.
> > >
> > > Hi there.
> > >
> > > I have Torque 1.1 running and everything works great now. Dev got
a
> >lot
> > > easier.
> > >
> > > My only trouble is: what happens if I have to change the
structure,
> > > because
> > > my client wants some additional data to be saved in the DB? Once,
I
> >tried
> > > to copy my local version of both the WebApp (class files)  + exact
> >Copy of
> > > the DB to the server, but then torque refused to create new
objects -
> > > everything else: delete and read worked great.
> > >
> > > This seemed to have something to do with the id_table, but: I
don't
> > > understand why it does not work, because I got the exact copy of
teh
> > > id_table locally and remotely.
> > >
> > > ---
> > >
> > > What happens if i create my OM class files again with torque
> >generator? is
> > > there somewhere a unique key added, that then differentiates each
> >version
> > > of the generated files?
> > >
> > > ---
> > >
> > > thanx,
> > > sven
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> >For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


RE: How to migrate to a new db structure.

Posted by Sven Haiges <sh...@flavor.de>.
Kind of.

but you are right, these are two.

so: 1. Why can't I just copy the database and the web-app to my server? Why 
can i read and change, but not add new entries with the Torque om models?

2. how would i add some more features to my objects, and migrate all the 
data to the new tables in an easy way?

thanx!
sven

At 02:15 PM 10/11/2003 -0800, you wrote:

>I see two different questions, (1) you're planning to modify db
>structure, and (2) your app works locally but not on the remote server.
>Are these questions related?
>
> > -----Original Message-----
> > From: Sven Haiges [mailto:sh@flavor.de]
> > Sent: Monday, November 10, 2003 12:55 PM
> > To: torque-user@db.apache.org
> > Subject: How to migrate to a new db structure.
> >
> > Hi there.
> >
> > I have Torque 1.1 running and everything works great now. Dev got a
>lot
> > easier.
> >
> > My only trouble is: what happens if I have to change the structure,
> > because
> > my client wants some additional data to be saved in the DB? Once, I
>tried
> > to copy my local version of both the WebApp (class files)  + exact
>Copy of
> > the DB to the server, but then torque refused to create new objects -
> > everything else: delete and read worked great.
> >
> > This seemed to have something to do with the id_table, but: I don't
> > understand why it does not work, because I got the exact copy of teh
> > id_table locally and remotely.
> >
> > ---
> >
> > What happens if i create my OM class files again with torque
>generator? is
> > there somewhere a unique key added, that then differentiates each
>version
> > of the generated files?
> >
> > ---
> >
> > thanx,
> > sven
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-user-help@db.apache.org




RE: How to migrate to a new db structure.

Posted by Ramesh Sabeti <rs...@reazon.com>.
I see two different questions, (1) you're planning to modify db
structure, and (2) your app works locally but not on the remote server.
Are these questions related?

> -----Original Message-----
> From: Sven Haiges [mailto:sh@flavor.de]
> Sent: Monday, November 10, 2003 12:55 PM
> To: torque-user@db.apache.org
> Subject: How to migrate to a new db structure.
> 
> Hi there.
> 
> I have Torque 1.1 running and everything works great now. Dev got a
lot
> easier.
> 
> My only trouble is: what happens if I have to change the structure,
> because
> my client wants some additional data to be saved in the DB? Once, I
tried
> to copy my local version of both the WebApp (class files)  + exact
Copy of
> the DB to the server, but then torque refused to create new objects -
> everything else: delete and read worked great.
> 
> This seemed to have something to do with the id_table, but: I don't
> understand why it does not work, because I got the exact copy of teh
> id_table locally and remotely.
> 
> ---
> 
> What happens if i create my OM class files again with torque
generator? is
> there somewhere a unique key added, that then differentiates each
version
> of the generated files?
> 
> ---
> 
> thanx,
> sven



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org