mardi 26 avril 2016

SQllite add foreign key to existing table [duplicate]

This question already has an answer here:

I need to add foreign key for my sqllite table. How can do this? i have table history and now i need to add foreign key crypto_data_id in it.

here is my request:

ALTER TABLE History ADD CONSTRAINT crypto_id_data FOREIGN KEY(crypto_data_id) REFERENCES CryptoData(_id) DEFAULT NULL;

Why it doesnt work?

Aucun commentaire:

Enregistrer un commentaire