@@ -265,3 +265,22 @@ CREATE TABLE IF NOT EXISTS place_progress_events (
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS place_progress_owner_idx ON place_progress_events(owner_client_id,created_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS place_progress_source_idx ON place_progress_events(source_client_id,created_at DESC);
|
||||
|
||||
-- V4.5 Place bonus economy: lottery draw rewards, active-time rewards and
|
||||
-- manual admin grants. event_key makes externally triggered rewards idempotent.
|
||||
CREATE TABLE IF NOT EXISTS place_bonus_events (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
event_key TEXT NOT NULL UNIQUE,
|
||||
owner_client_id TEXT NOT NULL REFERENCES clients(id) ON DELETE CASCADE,
|
||||
source_client_id TEXT NOT NULL REFERENCES clients(id) ON DELETE CASCADE,
|
||||
task_id TEXT NOT NULL DEFAULT '',
|
||||
kind TEXT NOT NULL,
|
||||
points_milli INTEGER NOT NULL,
|
||||
multiplier REAL NOT NULL DEFAULT 1,
|
||||
units INTEGER NOT NULL DEFAULT 1,
|
||||
detail TEXT NOT NULL DEFAULT '',
|
||||
created_at INTEGER NOT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS place_bonus_owner_idx ON place_bonus_events(owner_client_id,created_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS place_bonus_source_idx ON place_bonus_events(source_client_id,created_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS place_bonus_kind_idx ON place_bonus_events(kind,created_at DESC);
|
||||
|
||||
Reference in New Issue
Block a user