From: "Bruce Altner" <[EMAIL PROTECTED]>
> Greetings:
>
> I'm sure that this must be a FAQ but I can't find it in the docs
anywhere...
Not sure if it is.
> What is the recommended practice for adding tables to an already
> established database? Do you go back to the beginning and run ant init on
> the entire (revised) schema so that Torque can create the new Peer classes
> or do you create them manually, using the existing classes as a model? The
> former approach would be easier, I think, but you'd have to back up your
data.
If your application is such that you can wipe the database then "ant init"
will do what you want. This will not be an option for a production system
where yo need to retain the data. As I must ultimately deploy my changes
to a production system, I work on my development database the same way
as production so that I can produce the scripts that I will later apply
there.
To do this, I update my schema file, execute the ant project-om target to
regenerate the peer classes and ant compile to compile them. I also execute
ant project-sql to produce the sql that would be used if I was to init the
project - I do this only because it is sometimes useful to refer to
{project}-schema.sql while manually producing the sql script to alter
the database structure. Producing and executing the sql script and making
sure everything works as expected are obviously last steps.
> There is a boolean switch in build.properties called
> "database.manual.creation." If this is set to true does Torque build the
> Peer classes but allow you to add the tables manually, preserving your
> existing tables (and data!)?
I am pretty sure this is the case. Backup your database and try it ;-)
> Thanks,
> Bruce
Cheers,
Scott
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>