Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreign key doesn`t work #176

Open
GoogleCodeExporter opened this issue Jun 24, 2015 · 2 comments
Open

Foreign key doesn`t work #176

GoogleCodeExporter opened this issue Jun 24, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.I create a normal table with two FK of diferentes table, I have definied the 
constraints neccesary for ON DELETE CASCADE , but the the libray doesn´t 
delete the other tables and it doesnot show any error message.

2.I'm using silverlight 4 out of browser and the bd is in the isolated storage 
of silverlight

I Have not defined the SQLITE_OMIT_FOREIGN_KEY so it should work.
I have test the creation tables with a sqlite browser and then it works.






Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 16 Jan 2013 at 4:34

@GoogleCodeExporter
Copy link
Author

Please read http://www.sqlite.org/foreignkeys.html and confirm you have 
followed all the steps under

2. Enabling Foreign Key Support

In order to use foreign key constraints in SQLite, the library must be compiled 
with neither SQLITE_OMIT_FOREIGN_KEY or SQLITE_OMIT_TRIGGER defined. If 
SQLITE_OMIT_TRIGGER is defined but SQLITE_OMIT_FOREIGN_KEY is not, then SQLite 
behaves as it did prior to version 3.6.19 - foreign key definitions are parsed 
and may be queried using PRAGMA foreign_key_list, but foreign key constraints 
are not enforced. 

...

Assuming the library is compiled with foreign key constraints enabled, it must 
still be enabled by the application at runtime, using the PRAGMA foreign_keys 
command. For example:

sqlite> PRAGMA foreign_keys = ON;

Original comment by [email protected] on 16 Jan 2013 at 4:49

  • Changed state: Reviewed

@GoogleCodeExporter
Copy link
Author

Yes It almost works but I have  the child table is parent of another table so 
if delete  a row of activity table , sqlilte library no delete the rows of the 
last table.
I expect that sqlite delete the rows of PlanActivity ,TimeTable that are 
affected by the activity row delete.
-Table activity(Gran father)
 Id activity
 Another data
-Table PlanActivity(Child)
 Fk_idActivity
 Fk_idTimeTable
-Table TimeTable(Child of child)
 id Timetable
 anohter data
Thanks

Original comment by [email protected] on 16 Jan 2013 at 6:14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant