I have the following doubt, build a model with mysql and when exporting the script and executing it, all the works are created except this one, the keys are declared and the tables that form this one also have it, what would be the error and what I have To take into account so that it does not happen or to be able to solve it if it happens to me in the future?
Thank you very much
CREATE TABLE IF NOT EXISTS 'PuestoArea' (
'idPuestoArea' int NOT NULL,
'idArea_FK' int NOT NULL,
'idPuesto_FK' int NOT NULL,
PRIMARY KEY ('idPuestoArea'),
INDEX 'fk_Area_has_Puesto_Puesto1_idx' ('idPuesto_FK' ASC),
INDEX 'fk_Area_has_Puesto_Area1_idx' ('idArea_FK' ASC),
CONSTRAINT 'fk_Area_has_Puesto_Area1'
FOREIGN KEY ('idArea_FK')
REFERENCES 'Area' ('idArea')
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT 'fk_Area_has_Puesto_Puesto1'
FOREIGN KEY ('idPuesto_FK')
REFERENCES 'Puesto' ('idPuesto')
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
Table Position and Area:
CREATE TABLE 'Puesto' (
'idPuesto' int NOT NULL,
'detPuesto' VARCHAR(100) NOT NULL,
PRIMARY KEY ('idPuesto'))
ENGINE = InnoDB;
CREATE TABLE 'Area' (
'idArea' int NOT NULL,
'detArea' VARCHAR(100) NOT NULL,
PRIMARY KEY ('idArea'))
ENGINE = InnoDB;
I do not know how to put a table here but it would be an example: Position:
idPuesto detPuesto
1 Tecnico
2 Supervisor
Area:
idArea detArea
1 Mantenimiento
2 Finanzas
Position Area:
idPuestoArea idArea_FK idPuesto_FK
1 1 2