Why this error shows up?
My logic is if the user 1 that follows user 2, and user 1 account got deleted the following for the user 2 will be removed same goes for the following table
CREATE TABLE [Followers]
(
[id] int NOT NULL PRIMARY KEY IDENTITY(1,1),
[userId] int NOT NULL,
[followerID] int NOT NULL,
CONSTRAINT userIdFollowed
FOREIGN KEY (userId) REFERENCES [User](id)
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT userIdFollower
FOREIGN KEY (followerID) REFERENCES [User](id)
ON DELETE CASCADE
ON UPDATE CASCADE,
);
CREATE TABLE [Following]
(
[id] int NOT NULL PRIMARY KEY IDENTITY(1,1),
[userId] int NOT NULL,
[followingID] int NOT NULL,
CONSTRAINT userIdFollow
FOREIGN KEY (userId) REFERENCES [User](id)
ON DELETE CASCADE
ON UPDATE NO ACTION,
CONSTRAINT userIdFollowing
FOREIGN KEY (followingID) REFERENCES [User](id)
ON DELETE CASCADE
ON UPDATE NO ACTION,
);
l found out that l was repeating myself in the code and that how l fixed it