analytics tables (#997)

This commit is contained in:
Brandon Thomas
2026-01-21 00:52:02 -05:00
committed by GitHub
parent 6b94196f2b
commit 67f428eee7
33 changed files with 259 additions and 0 deletions
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN total_generation_count;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN total_generation_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN image_generation_count;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN image_generation_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN video_generation_count;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN video_generation_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN object_generation_count;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN object_generation_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN text_to_image_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN text_to_image_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN image_to_image_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN image_to_image_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN text_to_video_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN text_to_video_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN image_to_video_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN image_to_video_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN text_to_object_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN text_to_object_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN image_to_object_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN image_to_object_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN image_page_prompt_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN image_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN video_page_prompt_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN video_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN edit_page_prompt_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN edit_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN stage_page_prompt_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN stage_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN object_page_prompt_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN object_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions DROP COLUMN other_page_prompt_count ;
@@ -0,0 +1,8 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE analytics_app_sessions
ADD COLUMN other_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0;
@@ -44,6 +44,57 @@ CREATE TABLE analytics_app_sessions (
-- change the ping cadence (eg. 1 minute pings --> 5 minute pings).
measurement_count BIGINT UNSIGNED NOT NULL DEFAULT 0,
-- ========== GENERATION COUNTS ==========
-- Number of items generated across all types.
-- This counts attempts, not successes. This also includes multiples,
-- eg. four requested images adds four to this total.
-- Two bytes (65,535 max)
total_generation_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
-- Number of images generated
-- This counts attempts, not successes. This also includes multiples,
-- eg. four requested images adds four to this total.
-- Two bytes (65,535 max)
image_generation_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
-- Number of images generated
-- This counts attempts, not successes. This also includes multiples,
-- eg. four requested images adds four to this total.
-- Two bytes (65,535 max)
video_generation_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
-- Number of objects generated (meshes, etc.)
-- This counts attempts, not successes. This also includes multiples,
-- eg. four requested images adds four to this total.
-- Two bytes (65,535 max)
object_generation_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
-- Number of images generated with text to image.
text_to_image_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
-- Number of images generated with text to image (image edits)
image_to_image_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
-- Number of videos generated with text to image.
text_to_video_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
-- Number of images generated with text to image.
image_to_video_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
-- Number of objects generated with text to image.
text_to_object_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
-- Number of objects generated with text to image.
image_to_object_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
image_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
video_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
edit_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
stage_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
object_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
other_page_prompt_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
-- ========== RECORD TIMESTAMPS ==========
-- Written at create only.