rewrite: New Pomodoro Timer system.

This commit is contained in:
2023-05-19 09:45:06 +03:00
parent 8d5840c696
commit 4aa2587c45
29 changed files with 2860 additions and 12 deletions

View File

@@ -0,0 +1,46 @@
from data import Registry, RowModel
from data.columns import Integer, Bool, Timestamp, String
class TimerData(Registry):
class Timer(RowModel):
"""
Schema
------
CREATE TABLE timers(
channelid BIGINT PRIMARY KEY,
guildid BIGINT NOT NULL REFERENCES guild_config (guildid),
ownerid BIGINT REFERENCES user_config,
manager_roleid BIGINT,
notification_channelid BIGINT,
focus_length INTEGER NOT NULL,
break_length INTEGER NOT NULL,
last_started TIMESTAMPTZ,
last_messageid BIGINT,
voice_alerts BOOLEAN,
inactivity_threshold INTEGER,
auto_restart BOOLEAN,
channel_name TEXT,
pretty_name TEXT
);
CREATE INDEX timers_guilds ON timers (guildid);
"""
_tablename_ = 'timers'
channelid = Integer(primary=True)
guildid = Integer()
ownerid = Integer()
manager_roleid = Integer()
last_started = Timestamp()
focus_length = Integer()
break_length = Integer()
auto_restart = Bool()
inactivity_threshold = Integer()
notification_channelid = Integer()
last_messageid = Integer()
voice_alerts = Bool()
channel_name = String()
pretty_name = String()