From b9268fcc88f2f2ff03be2ec43f6206350cfc64f7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Mar 2021 09:19:50 +0300 Subject: [PATCH] schema: add ttrss_users.last_auth_attempt --- classes/config.php | 2 +- sql/mysql/migrations/145.sql | 2 ++ sql/mysql/schema.sql | 3 ++- sql/pgsql/migrations/145.sql | 2 ++ sql/pgsql/schema.sql | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 sql/mysql/migrations/145.sql create mode 100644 sql/pgsql/migrations/145.sql diff --git a/classes/config.php b/classes/config.php index 2fa222092..f60b96f2a 100644 --- a/classes/config.php +++ b/classes/config.php @@ -6,7 +6,7 @@ class Config { const T_STRING = 2; const T_INT = 3; - const SCHEMA_VERSION = 144; + const SCHEMA_VERSION = 145; /* override defaults, defined below in _DEFAULTS[], prefixing with _ENVVAR_PREFIX: diff --git a/sql/mysql/migrations/145.sql b/sql/mysql/migrations/145.sql new file mode 100644 index 000000000..b49eccafc --- /dev/null +++ b/sql/mysql/migrations/145.sql @@ -0,0 +1,2 @@ +alter table ttrss_users add column last_auth_attempt datetime; +alter table ttrss_users alter column last_auth_attempt set default null; diff --git a/sql/mysql/schema.sql b/sql/mysql/schema.sql index 7ecaff32b..d8e6e270a 100644 --- a/sql/mysql/schema.sql +++ b/sql/mysql/schema.sql @@ -54,7 +54,8 @@ create table ttrss_users (id integer primary key not null auto_increment, twitter_oauth longtext default null, otp_enabled boolean not null default false, otp_secret varchar(250) default null, - resetpass_token varchar(250) default null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; + resetpass_token varchar(250) default null, + last_auth_attempt datetime default null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; insert into ttrss_users (login,pwd_hash,access_level) values ('admin', 'SHA1:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 10); diff --git a/sql/pgsql/migrations/145.sql b/sql/pgsql/migrations/145.sql new file mode 100644 index 000000000..754d06963 --- /dev/null +++ b/sql/pgsql/migrations/145.sql @@ -0,0 +1,2 @@ +alter table ttrss_users add column last_auth_attempt timestamp; +alter table ttrss_users alter column last_auth_attempt set default null; diff --git a/sql/pgsql/schema.sql b/sql/pgsql/schema.sql index 6130b633c..50bf375f2 100644 --- a/sql/pgsql/schema.sql +++ b/sql/pgsql/schema.sql @@ -52,6 +52,7 @@ create table ttrss_users (id serial not null primary key, otp_enabled boolean not null default false, otp_secret varchar(250) default null, resetpass_token varchar(250) default null, + last_auth_attempt timestamp default null, created timestamp default null); insert into ttrss_users (login,pwd_hash,access_level) values ('admin',