Public feed #529081

Ugarit

public text v1 · immutable
Raw Edit
·published 2007-06-01 19:44 UTC
rendered paste body
Cannot find an index in the referenced table where the
referenced columns appear as the first columns, or column types
in the table and the referenced table do not match for constraint.
Note that the internal storage type of ENUM and SET changed in
tables created with >= InnoDB-4.1.12, and such columns in old tables
cannot be referenced by such columns in new tables.
See http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html
for correct foreign key definition.
--
I'm getting this error with this table:

[root@localhost:3306] ERROR 1005: Can't create table '.\framework\official_state.frm' (errno: 150)

what am I doing wrong?

CREATE TABLE `official_state` (
  `id`                 INT,
  `mission_id`         INT, INDEX mission_index (mission_id),               FOREIGN KEY (mission_id)        REFERENCES mission(id),
  `orbit_state_id`     INT, INDEX orbit_state_index (orbit_state_id),       FOREIGN KEY (orbit_state_id)    REFERENCES orbit_state(id),
  `maneuver_state_id`  INT, INDEX maneuver_state_index (maneuver_state_id), FOREIGN KEY (maneuver_state_id) REFERENCES maneuver_state(id),
  `attitude_state_id`  INT, INDEX attitude_index (attitude_state_id),       FOREIGN KEY (attitude_state_id) REFERENCES attitude_state(id),
  `mass_state_id`      INT, INDEX mass_state_index (mass_state_id),         FOREIGN KEY (mass_state_id)     REFERENCES mass_state(id),
  `antenna_state_id`   INT, INDEX antenna_state_index (antenna_state_id),   FOREIGN KEY (antenna_state_id)  REFERENCES antenna_state(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;