feat(stats): Initial stats tracker.

This commit is contained in:
2025-07-27 16:41:51 +10:00
parent 9c0ae404c8
commit 0058568480
8 changed files with 575 additions and 63 deletions

View File

@@ -90,31 +90,6 @@ class Communities(RowModel):
_timestamp = Timestamp()
class Koan(RowModel):
"""
Schema
======
CREATE TABLE koans(
koanid INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
communityid INTEGER NOT NULL REFERENCES communities ON UPDATE CASCADE ON DELETE CASCADE,
name TEXT NOT NULL,
message TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
_timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
"""
_tablename_ = 'koans'
_cache_ = {}
koanid = Integer(primary=True)
communityid = Integer()
name = String()
message = String()
created_at = Timestamp()
_timestamp = Timestamp()
class BotData(Registry):
user_auth = UserAuth.table
@@ -129,5 +104,3 @@ class BotData(Registry):
bot_channels = BotChannel.table
user_profiles = UserProfile.table
communities = Communities.table
koans = Koan.table