为什么 SQLite 不强制执行以下外键约束(尽管执行得很好)?我该如何加强这种关系?
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)
)