feat(counters): Add details and initial refactor.

This commit is contained in:
2024-09-27 00:36:12 +10:00
parent 9c9107bf9d
commit 8f6fdf3381
4 changed files with 86 additions and 59 deletions

View File

@@ -1454,6 +1454,7 @@ CREATE TABLE shoutouts(
CREATE TABLE counters(
counterid SERIAL PRIMARY KEY,
name TEXT NOT NULL,
category TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE UNIQUE INDEX counters_name ON counters (name);
@@ -1464,6 +1465,7 @@ CREATE TABLE counter_log(
userid INTEGER NOT NULL,
value INTEGER NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
details TEXT,
context_str TEXT
);
CREATE INDEX counter_log_counterid ON counter_log (counterid);