Re: Wish

From: Todd O'Bryan (toddobrya..ac.com)
Date: Thu Jun 24 2004 - 11:31:01 EDT

  • Next message: Andrus Adamchik: "Re: Best use of Cayenne for a large scale game?"

    [Hand-waving justification for crappy software engineering practices: I
    teach high school, so my students and I evolve a system little by
    little.]

    I find myself in the position where I have the system up and running,
    it has been populated with a lot of data, and I suddenly realize that
    I'd like to have access to another piece of information (say, adding
    the AIM screen name to a User record because students use it to talk to
    each other about homework, or adding extra-curriculars after a schedule
    program has already been set up).

    Thus far, I've just used ALTER TABLE statements to bring the db
    up-to-date with the DataModel, but that gets old quickly. (Of course,
    saving the scripts as Michael suggests to create a history would
    probably make that seem less annoying.) In an ideal world, it seems
    like there should be a way to examine the database structure when the
    modeler opens, examine it when it's saved, and produce a script that
    would alter the tables in such a way that current data could be saved.
    (On the other hand, maybe I'm letting my ignorance of database theory
    show through here.)

    Hmm, maybe one of my advanced students has a project for next year...

    Todd

    On Jun 24, 2004, at 10:43 AM, Gentry, Michael wrote:

    > My approach has always been option #2. I set up the initial model and
    > then if I need to add columns/etc to the database, I add it to the
    > model
    > and save it. Then I create a patch script (schemaUpdate.01 or similar)
    > for the database (alter table blah...) and check the script into CVS.
    > I
    > also have the initial SQL used to create the database, if starting from
    > scratch, in CVS, too. This way, you don't lose your data and it is
    > easy
    > to see exactly how the schema evolved over time. It is fairly easy to
    > apply the patches to the database, even if setting up a new one -- you
    > can write a script for that, just execute all the patches in numerical
    > order.
    >
    > I actually prefer an approach like this to a more automated one in the
    > modeler because it shows the history better, but I can see the appeal
    > of
    > an automated approach, too.
    >
    > Hope that helps,
    >
    > /dev/mrg
    >
    >
    > -----Original Message-----
    > From: Elia Morling [mailto:eli..amiljen.se]
    > Sent: Thursday, June 24, 2004 8:37 AM
    > To: Sako!; cayenne-use..bjectstyle.org
    > Subject: Re: Wish
    >
    >
    > Sako, Thanks for your reply.
    >
    > Yup. I can connect to the database and Reenginner the Database Schema.
    > The
    > problems occur at a later stage when I make changes to my database. At
    > that
    > point I can either:
    > 1) Reenginner the Database Schema again, which will create a new
    > DataMap
    > and force me to reestablish relationships and attribute settings
    > or
    > 2) Make manual changes
    >
    > What I want is for the modeler to detect all new changes to my database
    > (new
    > fields etc.) and add them to the existing DataMap.
    >
    > Elia
    >
    > ----- Original Message -----
    > From: "Sako!" <webobject..tcc.datos.de>
    > To: "Elia Morling" <eli..amiljen.se>; <cayenne-user@objectstyle.org>;
    > "James Treleaven" <jametre..noreo.on.ca>
    > Sent: Thursday, June 24, 2004 1:32 PM
    > Subject: Re: Wish
    >
    >
    >> did you try this example Elia?
    >>
    > http://objectstyle.org/cayenne/modelerguide/object-relational-
    > modeling/e
    > xisting-database.html
    >>
    >> if you cant connect the DB. this is another Q.
    >>
    >> Sako.
    >> ----- Original Message -----
    >> From: "Elia Morling" <eli..amiljen.se>
    >> To: <cayenne-use..bjectstyle.org>; "James Treleaven"
    >> <jametre..noreo.on.ca>
    >> Sent: Wednesday, June 23, 2004 6:35 PM
    >> Subject: Re: Wish
    >>
    >>
    >>> Actually, neither. I want to Reengineer the Database Schema without
    >>> having it create a "new structure". I want it to retreive changes to
    >> columns
    >>> so that I don't have to do it manually for every change to the
    > database.
    >>>
    >>> Elia
    >>>
    >>> ----- Original Message -----
    >>> From: "James Treleaven" <jametre..noreo.on.ca>
    >>> To: <cayenne-use..bjectstyle.org>
    >>> Sent: Wednesday, June 23, 2004 5:22 PM
    >>> Subject: Re: Wish
    >>>
    >>>
    >>>> If you mean 'make the cayenne schema match the database schema'
    > this is
    >>>> easy to do with Tools->Reengineer Database Schema. If you mean
    > 'make
    >>>> the database schema match the cayenne schema' this can be done
    > with
    >>>> Tools->Generate Database Schema.
    >>>>
    >>>> James
    >>>>
    >>>> Elia Morling wrote:
    >>>>> Would it be possible for a "Resync Database Schema" in the
    > modeler?
    >>>>> Perhaps something for the future...
    >>>>>
    >>>>> Elia
    >>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Thu Jun 24 2004 - 11:31:08 EDT