Hello,
I was having a hard time understanding why a one-to-many relationship wasn't 
included in the .edmx of an Sqlite database, until I figured the issue is with 
the letter case of the referenced table in the foreign key definition. The 
following works ok:
CREATE TABLE Lesson (    id INTEGER PRIMARY KEY AUTOINCREMENT,    title TEXT 
NOT NULL);
CREATE TABLE Page (    lesson_id INTEGER NOT NULL,    id INTEGER PRIMARY KEY 
AUTOINCREMENT,    title TEXT NOT NULL,    FOREIGN KEY(lesson_id) 
REFERENCES Lesson(id));
while with the following, the relationship is not added:
CREATE TABLE Lesson (    id INTEGER PRIMARY KEY AUTOINCREMENT,    title TEXT 
NOT NULL);
CREATE TABLE Page (    lesson_id INTEGER NOT NULL,    id INTEGER PRIMARY KEY 
AUTOINCREMENT,    title TEXT NOT NULL,    FOREIGN KEY(lesson_id) REFERENCES 
lesson(id));
I'm guessing it's not a huge deal, but I thought I'd put it out there since it 
may be simple to fix.
Sincerely,
Ludovic Vaugeois-Pepin                                    
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to