cascading delete, mcaptcha add/del and test suite

This commit is contained in:
realaravinth
2021-03-11 20:58:18 +05:30
parent 6be10af6fd
commit 096dcd32e4
8 changed files with 287 additions and 85 deletions

View File

@@ -1,4 +1,4 @@
CREATE TABLE IF NOT EXISTS mcaptcha_domains (
name VARCHAR(100) PRIMARY KEY NOT NULL UNIQUE,
ID INTEGER references mcaptcha_users(ID) NOT NULL
ID INTEGER references mcaptcha_users(ID) ON DELETE CASCADE NOT NULL
);

View File

@@ -1,6 +1,7 @@
CREATE TABLE IF NOT EXISTS mcaptcha_config (
config_id SERIAL PRIMARY KEY NOT NULL,
ID INTEGER references mcaptcha_users(ID),
domain_name VARCHAR(100) NOT NULL references mcaptcha_domains(name) ON DELETE CASCADE,
key VARCHAR(100) NOT NULL UNIQUE,
name VARCHAR(100) NOT NULL UNIQUE,
duration INTEGER NOT NULL DEFAULT 30
);

View File

@@ -1,5 +1,5 @@
CREATE TABLE IF NOT EXISTS mcaptcha_levels (
config_id INTEGER references mcaptcha_config(config_id),
config_id INTEGER references mcaptcha_config(config_id) ON DELETE CASCADE,
difficulty_factor INTEGER NOT NULL,
visitor_threshold INTEGER NOT NULL,
level_id SERIAL PRIMARY KEY NOT NULL