On delete cascades added
This commit is contained in:
parent
86c12890c2
commit
f6d1376dbb
|
@ -21,7 +21,7 @@ CREATE TABLE Fingerprint (
|
||||||
PRIMARY KEY (FingerprintId),
|
PRIMARY KEY (FingerprintId),
|
||||||
UNIQUE KEY Fingerprint (Fingerprint),
|
UNIQUE KEY Fingerprint (Fingerprint),
|
||||||
KEY User (UserId),
|
KEY User (UserId),
|
||||||
CONSTRAINT User FOREIGN KEY (UserId) REFERENCES User (UserId)
|
CONSTRAINT User FOREIGN KEY (UserId) REFERENCES User (UserId) ON DELETE CASCADE
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE Sharing (
|
CREATE TABLE Sharing (
|
||||||
|
@ -31,8 +31,8 @@ CREATE TABLE Sharing (
|
||||||
PRIMARY KEY (SharingId),
|
PRIMARY KEY (SharingId),
|
||||||
UNIQUE KEY User (User, UserShared),
|
UNIQUE KEY User (User, UserShared),
|
||||||
KEY UserSharedId (UserShared),
|
KEY UserSharedId (UserShared),
|
||||||
CONSTRAINT UserId FOREIGN KEY (User) REFERENCES User (UserId),
|
CONSTRAINT UserId FOREIGN KEY (User) REFERENCES User (UserId) ON DELETE CASCADE,
|
||||||
CONSTRAINT UserSharedId FOREIGN KEY (UserShared) REFERENCES User (UserId)
|
CONSTRAINT UserSharedId FOREIGN KEY (UserShared) REFERENCES User (UserId) ON DELETE CASCADE
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
Loading…
Reference in New Issue