Relationship of tables with error 1215

0

Hello, I'm trying to make a table relationship, it just gives me error ... I have my table tb_conta_fixa and my table users

I want to relate the data created from tb_conta_fixa to table users ...

I put this query:

ALTER TABLE tb_conta_fixa ADD CONSTRAINT code_user 
FOREIGN KEY(codigo_conta_fixa) REFERENCES users(codigo_conta_fixa)

But it does show an error:

# 1215 - Can not add foreign key constraint

I will post the pictures of how my table is, I think her type and names are the same, I do not know why she is giving an error.

If someone can help me, I'll be very grateful ... Thank you. (I'm starting)

    
asked by anonymous 30.07.2018 / 20:01

0 answers