2003年 7月 7日 月曜日 18:02、Rafal Kedziorski さんは書きました:
> At 17:58 07.07.2003 +0900, Nils Valentin wrote:
> >2003年 7月 7日 月曜日 17:43、Rafal Kedziorski 
さんは書きました:
> > > hi,
> > >
> > > I'm porting an PostgreSQL script to MySQL. I get an error:
> > >
> > > Can't create table '.\mmcms\mandant.frm' (errno: 150)
> > >
> > > for this tables:
> > >
> > > CREATE TABLE `firm` (
> > >    `firm_id` SMALLINT      NOT NULL AUTO_INCREMENT,
> > >    `name`    VARCHAR  (40) NOT NULL,
> > >    #
> > >    PRIMARY KEY (`firm_id`)
> > > ) TYPE=InnoDB;
> > >
> > >
> > > CREATE TABLE `mandant` (
> > >    `mandant_id`    SMALLINT       NOT NULL AUTO_INCREMENT,
> > >    `firm_id`       SMALLINT       NOT NULL,
> > >    `parent_id`     SMALLINT,
> > >    `name`          VARCHAR   (20) NOT NULL,
> > >    `creation_date` TIMESTAMP      NOT NULL,
> > >    #
> > >    PRIMARY KEY (`mandant_id`),
> > >    FOREIGN KEY (`firm_id`)
> > >          REFERENCES `firm` (`firm_id`),
> > >    FOREIGN KEY (`parent_id`)
> > >          REFERENCES `mandant` (`mandant_id`)
> > > ) TYPE=InnoDB;
> >
> >The foreign key points to the table mandant. But the column mandant_id is
> > not indexed. (f.e no Primary key)
>
> dasn't PRIMARY KEY create an INDEX?

Yes thats correct, both attempts lead to the wanted result. I just received 
your second post (solution) actually after I send my first reply.

Best regards

Nils Valentin
Tokyo/Japan
>
>
> Rafal

-- 
---
Valentin Nils
Internet Technology

 E-Mail: [EMAIL PROTECTED]
 URL: http://www.knowd.co.jp
 Personal URL: http://www.knowd.co.jp/staff/nils


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

Reply via email to