fix: associate challenges with usernames

This commit is contained in:
Aravinth Manivannan
2023-06-17 16:13:48 +05:30
parent e7b01a5b06
commit 6f029d2945
10 changed files with 193 additions and 111 deletions

View File

@@ -10,6 +10,13 @@ CREATE TABLE IF NOT EXISTS mcaptcha_challenge (
reason INT NOT NULL,
challenge_id varchar(40) NOT NULL UNIQUE,
received timestamp NOT NULL DEFAULT now(),
user_id INT NOT NULL,
CONSTRAINT `fk_mcaptcha_challenge_user`
FOREIGN KEY (user_id)
REFERENCES mcaptcha_users (ID)
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT `fk_mcaptcha_mcaptcha_challenge_reason`
FOREIGN KEY (reason)