Hello, I'm trying to add a foreign key to a table but I get error 1215. I've already checked the attributes and all are compatible, the wallet field is a primary key, I do not understand why it's not possible to add the key.
ALTER TABLE 'acoes_db'.'Carteira'
ADD CONSTRAINT 'carteira_fk'
FOREIGN KEY ('ID')
REFERENCES 'acoes_db'.'Acionistas' ('Carteira')
ON DELETE CASCADE
ON UPDATE CASCADE;