mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 01:47:47 +08:00
feat: revamp analytics dashboards and harden database migrations
Add dashboard and overview analytics, health monitoring, provider expense tracking, and announcement updates across the gateway and frontend. Keep schema migrations free of historical backfills while preserving automatic backfill execution. Bound migration deadlines, run schema preparation before Compose replacement, and anonymize deleted dashboard users. Include the current documentation cleanup and regression coverage.
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
-- Generated by aether-data-schema from crates/aether-data/runtime/schema/logical/*.toml.
|
||||
-- Do not edit generated files directly; edit logical schema or explicit overrides instead.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dashboard_activity_hour (
|
||||
bucket_start timestamp with time zone NOT NULL,
|
||||
shard smallint NOT NULL,
|
||||
request_count bigint NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE ONLY public.dashboard_activity_hour ADD CONSTRAINT dashboard_activity_hour_pkey PRIMARY KEY (bucket_start, shard);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dashboard_activity_minute (
|
||||
bucket_start timestamp with time zone NOT NULL,
|
||||
shard smallint NOT NULL,
|
||||
request_count bigint NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE ONLY public.dashboard_activity_minute ADD CONSTRAINT dashboard_activity_minute_pkey PRIMARY KEY (bucket_start, shard);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dashboard_actor_minute (
|
||||
bucket_start timestamp with time zone NOT NULL,
|
||||
shard smallint NOT NULL,
|
||||
actor_user_id character varying(255) NOT NULL,
|
||||
request_count bigint NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE ONLY public.dashboard_actor_minute ADD CONSTRAINT dashboard_actor_minute_pkey PRIMARY KEY (bucket_start, shard, actor_user_id);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dashboard_request_contributions (
|
||||
request_id character varying(100) NOT NULL,
|
||||
created_at timestamp with time zone NOT NULL,
|
||||
actor_user_id character varying(255),
|
||||
metrics jsonb NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE ONLY public.dashboard_request_contributions ADD CONSTRAINT dashboard_request_contributions_pkey PRIMARY KEY (request_id);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dashboard_stats_minute (
|
||||
bucket_start timestamp with time zone NOT NULL,
|
||||
shard smallint NOT NULL,
|
||||
metrics jsonb DEFAULT '{}'::jsonb NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE ONLY public.dashboard_stats_minute ADD CONSTRAINT dashboard_stats_minute_pkey PRIMARY KEY (bucket_start, shard);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dashboard_stats_pending (
|
||||
transaction_id bigint NOT NULL,
|
||||
request_id character varying(100) NOT NULL,
|
||||
deleted_fact jsonb
|
||||
);
|
||||
|
||||
ALTER TABLE ONLY public.dashboard_stats_pending ADD CONSTRAINT dashboard_stats_pending_pkey PRIMARY KEY (transaction_id, request_id);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dashboard_stats_state (
|
||||
singleton boolean DEFAULT true NOT NULL,
|
||||
stats_since timestamp with time zone NOT NULL,
|
||||
contributions_cleanup_cursor character varying(100)
|
||||
);
|
||||
|
||||
ALTER TABLE ONLY public.dashboard_stats_state ADD CONSTRAINT dashboard_stats_state_pkey PRIMARY KEY (singleton);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dashboard_stats_total (
|
||||
shard smallint NOT NULL,
|
||||
metrics jsonb DEFAULT '{}'::jsonb NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE ONLY public.dashboard_stats_total ADD CONSTRAINT dashboard_stats_total_pkey PRIMARY KEY (shard);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dashboard_user_anonymization_pending (
|
||||
transaction_id bigint NOT NULL,
|
||||
user_id character varying(255) NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE ONLY public.dashboard_user_anonymization_pending ADD CONSTRAINT dashboard_user_anonymization_pending_pkey PRIMARY KEY (transaction_id, user_id);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.dashboard_user_events_minute (
|
||||
bucket_start timestamp with time zone NOT NULL,
|
||||
shard smallint NOT NULL,
|
||||
created_count bigint DEFAULT 0 NOT NULL,
|
||||
deleted_count bigint DEFAULT 0 NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE ONLY public.dashboard_user_events_minute ADD CONSTRAINT dashboard_user_events_minute_pkey PRIMARY KEY (bucket_start, shard);
|
||||
|
||||
Reference in New Issue
Block a user