SQLite Foreign key setting
I am creating an SQLite database with SQLite Manager plug-in on Firefox. When I create the database and I want to enable Foreign Keys I go to DB Settings and switch the "Foreign Keys" option to "On". When I change this it works perfectly
However when I close the database, and re-open it the settin开发者_JAVA百科g is switched back to off. Does anyone know why this is?
That behavior is by design.
Foreign Keys can be enabled manually for each database session by going to the DB Settings tab and setting the Foreign Keys switch to ON.
Note that phrase "for each database session". This just follows the default behavior of SQLite itself, which doesn't provide a way to "set it and forget it".
精彩评论