mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-07-12 20:16:21 +02:00
Completely rewrite SQLite schema for table 'users_throttling'
This commit is contained in:
@ -51,10 +51,9 @@ CREATE TABLE "users_resets" (
|
|||||||
CREATE INDEX "users_resets.user_expires" ON "users_resets" ("user", "expires");
|
CREATE INDEX "users_resets.user_expires" ON "users_resets" ("user", "expires");
|
||||||
|
|
||||||
CREATE TABLE "users_throttling" (
|
CREATE TABLE "users_throttling" (
|
||||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK ("id" >= 0),
|
"bucket" VARCHAR(44) PRIMARY KEY NOT NULL,
|
||||||
"action_type" TEXT NOT NULL CHECK ("action_type" IN ("login", "register", "confirm_email")),
|
"tokens" REAL NOT NULL CHECK ("tokens" >= 0),
|
||||||
"selector" VARCHAR(44) DEFAULT NULL,
|
"replenished_at" INTEGER NOT NULL CHECK ("replenished_at" >= 0),
|
||||||
"time_bucket" INTEGER NOT NULL CHECK ("time_bucket" >= 0),
|
"expires_at" INTEGER NOT NULL CHECK ("expires_at" >= 0)
|
||||||
"attempts" INTEGER NOT NULL CHECK ("attempts" >= 0) DEFAULT "1",
|
|
||||||
CONSTRAINT "action_type_selector_time_bucket" UNIQUE ("action_type", "selector", "time_bucket")
|
|
||||||
);
|
);
|
||||||
|
CREATE INDEX "users_throttling.expires_at" ON "users_throttling" ("expires_at");
|
||||||
|
Reference in New Issue
Block a user