about summary refs log tree commit diff stats
path: root/sql/pgsql
diff options
context:
space:
mode:
authorfox <fox@fakecake.org>2026-06-21 14:51:01 +0300
committerfox <fox@fakecake.org>2026-06-21 14:51:01 +0300
commit8e569855249dda7a17402e5ae20044e8149d992e (patch)
tree6a6acc9a378e2402d048a02e47b5ab99dc5247e2 /sql/pgsql
parent23ca9695d1b38c7a27cf132d517a6ed6b19f607a (diff)
parent17296a2ef8fa2658dca471285bce40ee67469179 (diff)
downloadthe-epube-8e569855249dda7a17402e5ae20044e8149d992e.tar.gz
the-epube-8e569855249dda7a17402e5ae20044e8149d992e.tar.xz
Merge branch 'dev' into 'master'
rework login throttling to use database field check instead of APCu

See merge request git/the-epube!64
Diffstat (limited to 'sql/pgsql')
-rw-r--r--sql/pgsql/migrations/3.sql2
-rw-r--r--sql/pgsql/schema.sql6
2 files changed, 6 insertions, 2 deletions
diff --git a/sql/pgsql/migrations/3.sql b/sql/pgsql/migrations/3.sql
new file mode 100644
index 0000000..e23d0ca
--- /dev/null
+++ b/sql/pgsql/migrations/3.sql
@@ -0,0 +1,2 @@
+alter table epube_users add column last_auth_attempt bigint default null;
+create index epube_users_last_auth_attempt on epube_users(last_auth_attempt);
diff --git a/sql/pgsql/schema.sql b/sql/pgsql/schema.sql
index 2d02190..df76b16 100644
--- a/sql/pgsql/schema.sql
+++ b/sql/pgsql/schema.sql
@@ -1,7 +1,8 @@
 create table if not exists epube_users (
 	id serial not null primary key,
 	username varchar(100) not null unique,
-	pass varchar(200) not null);
+	pass varchar(200) not null,
+	last_auth_attempt bigint default null);
 
 create table if not exists epube_pagination (
 	id serial not null primary key,
@@ -26,4 +27,5 @@ create table if not exists epube_sessions (id varchar(250) not null primary key,
 	data text,
 	expire integer not null);
 
-create index epube_sessions_expire_index on epube_sessions(expire);
+create index if not exists epube_sessions_expire_index on epube_sessions(expire);
+create index if not exists epube_users_last_auth_attempt on epube_users(last_auth_attempt);