add usages count for every token

This commit is contained in:
norohind committed 2022-01-05 22:01:54 +03:00
1 parent bc2e13786f
commit d50df50ca1
3 files changed
+11 -2

No files matched your search

+4 -1
View File
@@ -8,7 +8,8 @@ schema = """create table if not exists authorizations (
expires_in text,
timestamp_got_expires_in text,
nickname text unique,
refresh_tries int default 0
refresh_tries int default 0,
usages int default 0
);"""
insert_auth_init = """insert into authorizations
@@ -48,3 +49,5 @@ from authorizations where state = :state;"""
select_nickname_state_all = """select nickname, state from authorizations where nickname is not null;"""
del_orphans = """delete from authorizations where nickname is null;"""
increment_usages = "update authorizations set usages = usages + 1 where state = :state;"