Foreign Keys in SQLITE in the Google Gears framework

Posted by Maxim Gershkovich on Stack Overflow See other posts from Stack Overflow or by Maxim Gershkovich
Published on 2010-06-11T04:27:49Z Indexed on 2010/06/11 4:32 UTC
Read the original article Hit count: 203

Filed under:
|

Hi all,

Could someone please tell me why the following foreign key constraint (although executes fine) is not enforced by SQLITE? Could someone pleasse provide an example of how I can go about enforcing the relationship?

CREATE TABLE User (UserID TEXT Unique NOT NULL PRIMARY KEY, FirstName TEXT NOT NULL, LastName TEXT NOT NULL, Username TEXT NOT NULL, Password TEXT NOT NULL, Email TEXT NOT NULL, SignupDate TEXT NOT NULL)

CREATE TABLE Category (CategoryID TEXT Unique NOT NULL PRIMARY KEY, UserID TEXT, FOREIGN KEY(UserID) REFERENCES User(UserID))

© Stack Overflow or respective owner

Related posts about sqlite

Related posts about google-gears