diff --git a/_database/sql/migrations/2026-06-19-181006-0000_uploaded_videos/up.sql b/_database/sql/migrations/2026-06-19-181006-0000_uploaded_videos/up.sql index 60c7daf0c5..d27310762b 100644 --- a/_database/sql/migrations/2026-06-19-181006-0000_uploaded_videos/up.sql +++ b/_database/sql/migrations/2026-06-19-181006-0000_uploaded_videos/up.sql @@ -17,25 +17,31 @@ CREATE TABLE uploaded_videos ( filesize_bytes INT(10) UNSIGNED NOT NULL, -- Pixel dimensions, when they could be determined. - width INT(10) UNSIGNED DEFAULT NULL, - height INT(10) UNSIGNED DEFAULT NULL, + maybe_width INT(10) UNSIGNED DEFAULT NULL, + maybe_height INT(10) UNSIGNED DEFAULT NULL, + + -- Resolution label (e.g. "1080p", "1920x1080"), when known. + maybe_resolution VARCHAR(12) DEFAULT NULL, -- ========== DETECTION ========== -- Detected provenance family (e.g. "seedance", "veo", "sora", "dreamina", "kling"). - detected_model_family VARCHAR(32) DEFAULT NULL, + maybe_detected_model_family VARCHAR(32) DEFAULT NULL, -- Detected model type / variant (e.g. "full", "fast", "mini"). - detected_model_type VARCHAR(32) DEFAULT NULL, + maybe_detected_model_type VARCHAR(32) DEFAULT NULL, -- Free-form model name for anything that doesn't map to a known type. - other_model_name VARCHAR(64) DEFAULT NULL, + maybe_reported_model_name VARCHAR(64) DEFAULT NULL, - -- ========== IP ADDRESS ========== + -- ========== IP ADDRESSES ========== -- IP address that uploaded the video. Wide enough for IPv4/IPv6. upload_ip_address VARCHAR(40) NOT NULL, + -- IP address that last updated the row. Wide enough for IPv4/IPv6. + maybe_updated_ip_address VARCHAR(40) DEFAULT NULL, + -- ========== TIMESTAMPS ========== created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -45,6 +51,6 @@ CREATE TABLE uploaded_videos ( PRIMARY KEY (id), UNIQUE KEY (token), UNIQUE KEY (sha1_checksum), - KEY index_detected_model_family (detected_model_family) + KEY index_maybe_detected_model_family (maybe_detected_model_family) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; diff --git a/_database/sql/migrations/2026-06-19-181008-0000_uploaded_video_notes/up.sql b/_database/sql/migrations/2026-06-19-181008-0000_uploaded_video_notes/up.sql index 766ca37c83..3d5dfa8a13 100644 --- a/_database/sql/migrations/2026-06-19-181008-0000_uploaded_video_notes/up.sql +++ b/_database/sql/migrations/2026-06-19-181008-0000_uploaded_video_notes/up.sql @@ -8,6 +8,9 @@ CREATE TABLE uploaded_video_notes ( -- Effective "primary key" (used internally for lookups and as a foreign key). token VARCHAR(32) NOT NULL, + -- The uploaded video this note is about (FK to uploaded_videos.token). + uploaded_video_token VARCHAR(32) NOT NULL, + -- ========== SUBMISSION ========== -- Original filename of the submitted clip, as provided by the user. @@ -17,7 +20,7 @@ CREATE TABLE uploaded_video_notes ( reported_model_type VARCHAR(32) DEFAULT NULL, -- Free-form custom model name when the submitter's model isn't a known type. - reported_model_custom_name VARCHAR(64) DEFAULT NULL, + maybe_reported_model_name VARCHAR(64) DEFAULT NULL, -- The website / platform the video was obtained from. website VARCHAR(32) DEFAULT NULL, @@ -40,6 +43,7 @@ CREATE TABLE uploaded_video_notes ( -- INDICES -- PRIMARY KEY (id), - UNIQUE KEY (token) + UNIQUE KEY (token), + KEY fk_uploaded_video_token (uploaded_video_token) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; diff --git a/_database/sql/migrations_squashed/uploaded_video_notes.sql b/_database/sql/migrations_squashed/uploaded_video_notes.sql index 766ca37c83..3d5dfa8a13 100644 --- a/_database/sql/migrations_squashed/uploaded_video_notes.sql +++ b/_database/sql/migrations_squashed/uploaded_video_notes.sql @@ -8,6 +8,9 @@ CREATE TABLE uploaded_video_notes ( -- Effective "primary key" (used internally for lookups and as a foreign key). token VARCHAR(32) NOT NULL, + -- The uploaded video this note is about (FK to uploaded_videos.token). + uploaded_video_token VARCHAR(32) NOT NULL, + -- ========== SUBMISSION ========== -- Original filename of the submitted clip, as provided by the user. @@ -17,7 +20,7 @@ CREATE TABLE uploaded_video_notes ( reported_model_type VARCHAR(32) DEFAULT NULL, -- Free-form custom model name when the submitter's model isn't a known type. - reported_model_custom_name VARCHAR(64) DEFAULT NULL, + maybe_reported_model_name VARCHAR(64) DEFAULT NULL, -- The website / platform the video was obtained from. website VARCHAR(32) DEFAULT NULL, @@ -40,6 +43,7 @@ CREATE TABLE uploaded_video_notes ( -- INDICES -- PRIMARY KEY (id), - UNIQUE KEY (token) + UNIQUE KEY (token), + KEY fk_uploaded_video_token (uploaded_video_token) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; diff --git a/_database/sql/migrations_squashed/uploaded_videos.sql b/_database/sql/migrations_squashed/uploaded_videos.sql index 60c7daf0c5..d27310762b 100644 --- a/_database/sql/migrations_squashed/uploaded_videos.sql +++ b/_database/sql/migrations_squashed/uploaded_videos.sql @@ -17,25 +17,31 @@ CREATE TABLE uploaded_videos ( filesize_bytes INT(10) UNSIGNED NOT NULL, -- Pixel dimensions, when they could be determined. - width INT(10) UNSIGNED DEFAULT NULL, - height INT(10) UNSIGNED DEFAULT NULL, + maybe_width INT(10) UNSIGNED DEFAULT NULL, + maybe_height INT(10) UNSIGNED DEFAULT NULL, + + -- Resolution label (e.g. "1080p", "1920x1080"), when known. + maybe_resolution VARCHAR(12) DEFAULT NULL, -- ========== DETECTION ========== -- Detected provenance family (e.g. "seedance", "veo", "sora", "dreamina", "kling"). - detected_model_family VARCHAR(32) DEFAULT NULL, + maybe_detected_model_family VARCHAR(32) DEFAULT NULL, -- Detected model type / variant (e.g. "full", "fast", "mini"). - detected_model_type VARCHAR(32) DEFAULT NULL, + maybe_detected_model_type VARCHAR(32) DEFAULT NULL, -- Free-form model name for anything that doesn't map to a known type. - other_model_name VARCHAR(64) DEFAULT NULL, + maybe_reported_model_name VARCHAR(64) DEFAULT NULL, - -- ========== IP ADDRESS ========== + -- ========== IP ADDRESSES ========== -- IP address that uploaded the video. Wide enough for IPv4/IPv6. upload_ip_address VARCHAR(40) NOT NULL, + -- IP address that last updated the row. Wide enough for IPv4/IPv6. + maybe_updated_ip_address VARCHAR(40) DEFAULT NULL, + -- ========== TIMESTAMPS ========== created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -45,6 +51,6 @@ CREATE TABLE uploaded_videos ( PRIMARY KEY (id), UNIQUE KEY (token), UNIQUE KEY (sha1_checksum), - KEY index_detected_model_family (detected_model_family) + KEY index_maybe_detected_model_family (maybe_detected_model_family) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;