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)