0
I’m posting this question here, because as much as I’ve researched, I can’t solve it
I’m starting to study Mysql and the problem that occurred was this:
#1005 - Não pode criar a tabela `db_to_do_list`.`tb_concluido` (erro no. 150 "Foreign key constraint is incorrectly formed")
NOTE: I tried to take out the "DEFAULT 'Empty'" of fk_conteudo and it still doesn’t work.
OBS2: If I take the last FOREIGN KEY, the code works, but the fk_content that I would need to retrieve the "content" from tb_list would not work ;/
The tables are these:
CREATE TABLE tb_concluido(
id_conteudo_concluido INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
fk_id_conteudo INT NOT NULL,
fk_conteudo TEXT NOT NULL DEFAULT 'Vazio',
FOREIGN KEY (fk_id_conteudo) REFERENCES tb_lista (id_conteudo),
FOREIGN KEY (fk_conteudo) REFERENCES tb_lista (conteudo)
)
Thank you very much for the answer ! I did not know about this that you mentioned about "normalization". I researched here and it seems that foreign keys are always made by Ids even, I did not know this rsrs. Thank you very much, from a huasha heart I was stuck here and you helped me a lot now !! haha. Someday I hope to help back ^^
– Marcelo Blanc Moreira