RE: DbGenerator

From: Gentry, Michael \(Contractor\) ("Gentry,)
Date: Tue Mar 07 2006 - 15:31:37 EST

  • Next message: Paul Furbacher: "Re: DbGenerator"

    It sounds like there might be a permissions problem creating/updating
    the my.cnf file on OS X using that tool. This is actually a Good Thing,
    in a backhanded kind of way. :-)

    /dev/mrg

    -----Original Message-----
    From: Paul Furbacher [mailto:pfurbache..ac.com]
    Sent: Tuesday, March 07, 2006 3:14 PM
    To: cayenne-use..bjectstyle.org
    Subject: Re: DbGenerator

    Andrus,

    I have to apologize for wasting some of your precious time.

    It turns out that on OS X, the MySQL Administrator program gives
    one the impression that it is modifying the my.cnf file when
    actually it does nothing. So even though I thought I had
    set the default table type to InnoDB, it was starting up
    and defaulting to MyISAM (or whatever it is).

    [Grrrr, the number of bugs in the MySQL Admin app is
    beginning to get me quite upset. I mean, it's free software ...
    it ought to just work! (Smileys needed?)]

    Once I manually changed the setting in my.cnf to InnoDB,
    Cayenne Modeler did the right thing. Example:

    CREATE TABLE plates (
       creationTime DATETIME NULL,
       operatorID INT NOT NULL,
       plateID INT NOT NULL,
       plateTypeID INT NOT NULL,
       processedTime DATETIME NULL,
       sequenceConfigID INT NOT NULL,
       PRIMARY KEY (plateID),
       KEY (operatorID),
       KEY (plateTypeID),
       KEY (sequenceConfigID))
    ;

    ALTER TABLE plates ADD FOREIGN KEY (operatorID) REFERENCES persons
    (personID);
    ALTER TABLE plates ADD FOREIGN KEY (plateTypeID) REFERENCES
    platetypes (id);
    ALTER TABLE plates ADD FOREIGN KEY (sequenceConfigID) REFERENCES
    sequencerconfigurations (id);

    > Hmm... on the other hand if the default is not InnoDB, we
    > also need to change CREATE TABLE syntax to enforce
    > InnoDB. I need to patch the adapter further.

    Yes, if there are foreign keys implied by relationships in
    a de novo mapping (i.e., not sucked in from a "legacy"
    database), the following should probably be added after the
    right-paren before the end of the create table statement:

      ENGINE=InnoDB

    Don't know what you whether the default charset code be
    added as in

        ENGINE=InnoDB DEFAULT CHARSET=utf8

    ?

    Paul Furbacher



    This archive was generated by hypermail 2.0.0 : Tue Mar 07 2006 - 15:31:40 EST