RE: DbMerger/MySQL compatibility

From: Scott Anderson (sanderso..irvana.com)
Date: Thu Aug 28 2008 - 15:03:51 EDT

  • Next message: Tore Halset: "Re: DbMerger/MySQL compatibility"

    > Is it possible to detect this via jdbc?

    A rather long-winded way to detect table type is:
    SHOW CREATE TABLE [table name];

    This will return the full CREATE TABLE instruction required to rebuild
    that table. If this is already how you determine what the fields look
    like, it should be trivial to add logic to parse the ENGINE parameter.

    The query returns in the 'Create Table' field:
    CREATE TABLE `group_members` (
      `admin` tinyint(1) NOT NULL default '0',
      `idx` int(11) NOT NULL auto_increment,
      `name` varchar(128) collate latin1_general_cs NOT NULL,
      `active` tinyint(1) NOT NULL default '1',
      PRIMARY KEY (`idx`),
      UNIQUE KEY `name` (`name`)
    ) ENGINE=InnoDB AUTO_INCREMENT=8692 DEFAULT CHARSET=latin1
    COLLATE=latin1_general_cs

    There is probably a simpler way, but I don't know what that is :)

    -----Original Message-----
    From: Tore Halset [mailto:halse..vv.ntnu.no]
    Sent: Thursday, August 28, 2008 2:07 PM
    To: use..ayenne.apache.org
    Subject: Re: DbMerger/MySQL compatibility

    On Aug 28, 2008, at 19:34, Scott Anderson wrote:

    > It looks like the DbMerger in 3.0M4 isn't properly detecting whether
    > NULL is allowed for columns when using MySQL. Is this another issue
    > that
    > has already been fixed in trunk?

    I do not remember. Can you try with the latest build?
    http://hudson.zones.apache.org/hudson/job/Cayenne-trunk/lastBuild/org.ap
    ache.cayenne$cayenne-modeler-java/

    Unpack cayenne-modeler-java-3.0-SNAPSHOT.jar and run the
    CayenneModeler.jar.
    (Why do we have a jar with a jar??

    > Does it seem reasonable to expect the MySQL adapter to know that
    > MyISAM
    > doesn't support db-enforced FKs? I don't have the ability to use
    > InnoDB
    > on one of my target platforms, so DbMerger inevitably complains about
    > the relationships every time I check the schema.

    Please create a jira for this one. Is it possible to detect this via
    jdbc?

    It is not complete, but please log any issues you find, so we can fix
    them. I normally only use PostgreSQL and Derby, so I will detect
    things there first.

    Regards,
      - Tore.



    This archive was generated by hypermail 2.0.0 : Thu Aug 28 2008 - 15:05:40 EDT