hi,

I added two indexes in mandant table

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`),
  INDEX (`firm_id`),
  INDEX (`parent_id`),
  FOREIGN KEY (`firm_id`)
        REFERENCES `firm` (`firm_id`),
  FOREIGN KEY (`parent_id`)
        REFERENCES `mandant` (`mandant_id`)
) TYPE=InnoDB;

and it works.

Regards,
Rafal

At 10:43 07.07.2003 +0200, Rafal Kedziorski wrote:
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;


Regards, Rafal


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


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



Reply via email to