RE: how do I avoid gotchas with .sql files

From: Gentry, Michael (michael_gentr..anniemae.com)
Date: Wed Sep 29 2004 - 10:43:51 EDT

  • Next message: Dirk Rost: "NullPointer Exception Configuration.initializeSharedConfiguration()"

    I usually just fudge it until I get it right. Of course, I only do one
    schema change at a time at the SQL prompt (even if I combine multiple
    updates into a single file later on). Syntax errors are usually
    detected on the spot and nothing changes if the syntax is wrong.

    Have you looked into using a tool like this:

    http://cocoamysql.sourceforge.net/

    It has a console where it'll show you all the syntax used to do the
    schema changes (of course, it doesn't fully support *everything* yet).
    You can then copy/paste the commands out of the console window.

    There's also a PHP-based one that is pretty decent, but the name escapes
    me at the moment. Does anyone else on the list know of alternatives for
    MySQL?

    Thanks,

    /dev/mrg

    -----Original Message-----
    From: Todd O'Bryan [mailto:toddobrya..ac.com]
    Sent: Wednesday, September 29, 2004 12:16 AM
    To: cayenne-use..bjectstyle.org
    Subject: OT: how do I avoid gotchas with .sql files

    I'm using Cayenne with MySQL and, after I set up the database the first
    time, I'm using someone from the list's recommendation to save the SQL
    into a numbered file, modifying it to make it take the database as it
    was and update it to the new version I need. (Changing create table
    commands to alter table, for example, if the table already exists, not
    resetting AUTO_PK_UPDATE for tables that already have entries, etc.)

    Unfortunately, I'm not so good at spotting what I need to change, and I
    often seem to get errors while running the SQL file. Then half the file
    has executed and I'm forced to manually fix up what didn't get done.

    Is there an easy way to protect myself from my stupid screw-ups when
    I'm manually editing the .sql, or must I learn to be more careful.

    TIA,
    Todd



    This archive was generated by hypermail 2.0.0 : Wed Sep 29 2004 - 10:43:57 EDT