-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
bugConfirmed bugs or reports that are very likely to be bugs.Confirmed bugs or reports that are very likely to be bugs.constraints & foreign keys
Description
I have the following schema .. when I click the add record button, I get an error that it failed with foreign key constraint -
Why does the add record need to do a real INSERT before I have had a chance to edit the row?
(that's what the sql log is showing) ... this will never work.
BEGIN TRANSACTION;
CREATE TABLE "words" (
`groupid` INTEGER NOT NULL DEFAULT 1,
`word` TEXT NOT NULL,
`action` TEXT NOT NULL,
PRIMARY KEY(groupid,word),
FOREIGN KEY(`groupid`) REFERENCES `groups`(`groupid`) ON DELETE CASCADE
);
CREATE TABLE "groups" (
`groupid` INTEGER NOT NULL,
`name` TEXT NOT NULL,
`description` TEXT,
`enabled` INTEGER NOT NULL DEFAULT 1,
`canedit` INTEGER NOT NULL DEFAULT 1,
PRIMARY KEY(groupid)
);
COMMIT;`vtronko and z3ugma
Metadata
Metadata
Assignees
Labels
bugConfirmed bugs or reports that are very likely to be bugs.Confirmed bugs or reports that are very likely to be bugs.constraints & foreign keys