MySQL Forums
Forum List  »  Newbie

Foreign key constraint is incorrectly formed
Posted by: Salvador Castillo
Date: November 30, 2021 08:40AM

CREATE TABLE Usuario(

Idusuario INTEGER PRIMARY KEY AUTO_INCREMENT,
Idrol int NOT NULL,
Nombre VARCHAR(100) NOT NULL,
TipoDoc VARCHAR(20) NULL,
NumDoc VARCHAR(20) NULL,
Direccion VARCHAR(70) NULL,
Telefono VARCHAR(20) NULL,
Email VARCHAR(50) NOT NULL,
Password_Hash TINYBLOB NOT NULL,
Password_Salt TINYBLOB NOT NULL,
Condicion TINYINT DEFAULT(1),
FOREIGN KEY (Idrol) REFERENCES Role (Idrol)

);

send me this error. the table Role exist and is int (11). any help please

Options: ReplyQuote


Subject
Written By
Posted
Foreign key constraint is incorrectly formed
November 30, 2021 08:40AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.