Skip to main content
se añadieron 11 caracteres en el cuerpo
Origen Enlace
David
  • 365
  • 1
  • 4
  • 15

Estoy haciendo un create table y tengo dos constraints pero em da un error:

CREATE TABLE score (
score_id int NOT NULL AUTO_INCREMENT,
race_id int(11) NOT NULL,
modality_id int(11) NOT NULL,
header longtext,
PRIMARY KEY (score_id),
FOREIGN KEY (race_id) REFERENCES race(race_id),
FOREIGN KEY (modality_id) REFERENCES modality(modality_id)
);

1005 - No puedo crear tabla score (Error: 150 "Foreign key constraint is incorrectly formed")

Estoy haciendo un create table y tengo dos constraints pero em da un error:

CREATE TABLE score (
score_id int NOT NULL AUTO_INCREMENT,
race_id int(11) NOT NULL,
modality_id int(11) NOT NULL,
header longtext,
PRIMARY KEY (score_id),
FOREIGN KEY (race_id) REFERENCES race(race_id),
FOREIGN KEY (modality_id) modality(modality_id)
);

1005 - No puedo crear tabla score (Error: 150 "Foreign key constraint is incorrectly formed")

Estoy haciendo un create table y tengo dos constraints pero em da un error:

CREATE TABLE score (
score_id int NOT NULL AUTO_INCREMENT,
race_id int(11) NOT NULL,
modality_id int(11) NOT NULL,
header longtext,
PRIMARY KEY (score_id),
FOREIGN KEY (race_id) REFERENCES race(race_id),
FOREIGN KEY (modality_id) REFERENCES modality(modality_id)
);

1005 - No puedo crear tabla score (Error: 150 "Foreign key constraint is incorrectly formed")

Origen Enlace
David
  • 365
  • 1
  • 4
  • 15

Error Foregin key constraint

Estoy haciendo un create table y tengo dos constraints pero em da un error:

CREATE TABLE score (
score_id int NOT NULL AUTO_INCREMENT,
race_id int(11) NOT NULL,
modality_id int(11) NOT NULL,
header longtext,
PRIMARY KEY (score_id),
FOREIGN KEY (race_id) REFERENCES race(race_id),
FOREIGN KEY (modality_id) modality(modality_id)
);

1005 - No puedo crear tabla score (Error: 150 "Foreign key constraint is incorrectly formed")