I think it's not a matter of "before" or "after". Simply, a foreign key must
also be defined as a key/index. Which comes first in a CREATE statement
matters not a whit.

PB

-----
  ----- Original Message -----
  From: Thorsten Schmidt
  To: Ian Hartas
  Cc: [EMAIL PROTECTED]
  Sent: Friday, April 04, 2003 4:41 AM
  Subject: AW: AW: Re: Schema definition fails when converted to InnoDB


  > -----Ursprüngliche Nachricht-----
  > Von: Ian Hartas [mailto:[EMAIL PROTECTED]
  > Gesendet: Freitag, 4. April 2003 12:33
  > An: Thorsten Schmidt
  > Cc: [EMAIL PROTECTED]
  > Betreff: Re: AW: Re: Schema definition fails when converted to InnoDB
  >
  >
  > Thorsten,
  >
  > >This is right, but on these columns has to be an index set on before
  > >you can create foreign keys with innodb.
  > >
  > >So, create the indexes and AFTER that the foreign keys and it should
  > >work : )
  >
  > Thanks for the clarification !
  >
  > However, moving the foreign key definitions after the table
  > and index creation statements does not remove the problem.
  > More indexes are necessary.

  Both sides of the reference have to be indexed, the referenced key as well
as the foreign key.
  You should create all tables and indexes, and after all that the foreign
keys.

  Have a look at http://www.mysql.com/doc/en/SEC463.html

  Bye

  Thorsten

  > This seems to be an incompatibilty with Oracle where only the
  > referenced item has to be indexed.  :-((
  >
  > I request that the error message given by the 4.1 system
  > could be improved to avoid this confusion and better explain
  > the reason why it failed.
  >
  > --
  > regards,
  >     Ian Hartas
  > ---------------------------------------------
  > "Pluralitas non est ponenda sine neccesitate"
  >                Occam's Razor.
  > ---------------------------------------------
  >
  >
  >

  --
  MySQL General Mailing List
  For list archives: http://lists.mysql.com/mysql
  To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to