John Siracusa scribbled on 3/28/07 9:12 AM:
> On 3/28/07, Adrian Howard <[EMAIL PROTECTED]> wrote:
>>      CREATE TABLE products (
>>          id      SERIAL NOT NULL PRIMARY KEY,
>>          name    VARCHAR(255) NOT NULL,
>>          vendor_id  INT REFERENCES vendors (id),
>>          UNIQUE(name)
>>      ) TYPE = InnoDB;
> 
> While it will happily accept almost anything reasonable looking in a
> CREATE TABLE statement, MySQL is quite picky about how it wants you to
> express the creation of foreign keys.  See this post and then the one
> that it links to for some tips:
> 
> http://www.mail-archive.com/rose-db-object@lists.sourceforge.net/msg01338.html
> 
> If, after following those instructions, the Loader *still* doesn't
> make the expected method(s), post again :)

my experience using the 'serial' type with mysql with foreign keys and InnoDB 
was that I had to declare the corresponding data type as 'bigint unsigned not 
null' and not just 'int'.

That meant that I had to go back and edit my generated Rose classes to change 
the type for my primary keys back to 'int' in order to get the auto increment 
Rose magic to work.

I don't think Rose should change; just thought this experience would be helpful 
to other serial MySQL users... (puns always intended)

-- 
Peter Karman  .  http://peknet.com/  .  [EMAIL PROTECTED]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to