Files
Stat-Dashboard/mockups/db/006_daily_health_reports.sql

11 lines
407 B
SQL

SET search_path TO analytics, public;
CREATE TABLE daily_health_reports (
game_id bigint NOT NULL REFERENCES games(id),
report_date date NOT NULL,
period_days integer NOT NULL CHECK(period_days IN (1,7)),
generated_at timestamptz NOT NULL DEFAULT now(),
payload jsonb NOT NULL,
PRIMARY KEY(game_id,report_date,period_days)
);
INSERT INTO schema_migrations(version) VALUES('006_daily_health_reports');