diff --git a/_database/sql/migrations/2026-04-02-083548-0000_characters/up.sql b/_database/sql/migrations/2026-04-02-083548-0000_characters/up.sql index fde055800c..ad45445fda 100644 --- a/_database/sql/migrations/2026-04-02-083548-0000_characters/up.sql +++ b/_database/sql/migrations/2026-04-02-083548-0000_characters/up.sql @@ -29,6 +29,11 @@ CREATE TABLE characters ( -- Full-size reference image. maybe_full_image_media_token VARCHAR(32) DEFAULT NULL, + -- TEMPORARY FOR GOING FAST : + -- WE'LL NEED TO BREAK THIS INTO ANOTHER TABLE IF WE WANT TO SUPPORT MULTIPLE IMAGES. + -- Image the character was originally created with. + maybe_original_upload_media_token VARCHAR(32) DEFAULT NULL, + -- ========== CREATOR ========== -- The user who created this character. @@ -37,6 +42,36 @@ CREATE TABLE characters ( -- For abuse tracking. creator_ip_address VARCHAR(40) NOT NULL, + -- ========== KINOVI (TEMPORARY) ========== + + -- TEMPORARY FOR GOING FAST : + -- IDEALLY WE MOVE THIS TO A SEPARATE TABLE. + -- The identifier in the third-party system. + -- e.g. Kinovi's "char_1774752056469_2wlxoq" + kinovi_character_id VARCHAR(64) NOT NULL, + + -- TEMPORARY FOR GOING FAST : + -- IDEALLY WE MOVE THIS TO A SEPARATE TABLE. + -- The name used by the third party. + -- Important for Kinovi since characters are referenced by name in prompts. + kinovi_name VARCHAR(255) NOT NULL, + + -- TEMPORARY FOR GOING FAST : + -- IDEALLY WE MOVE THIS TO A SEPARATE TABLE. + -- This might be the upstream third party of kinovi. + -- e.g. Kinovi's assetId "asset-20260329104101-kk5kl" + maybe_kinovi_asset_id VARCHAR(64) DEFAULT NULL, + + -- TEMPORARY FOR GOING FAST : + -- IDEALLY WE MOVE THIS TO A SEPARATE TABLE. + -- Our job system token (if the character was created via a job). + maybe_generic_inference_job_token VARCHAR(32) DEFAULT NULL, + + -- TEMPORARY FOR GOING FAST : + -- IDEALLY WE MOVE THIS TO A SEPARATE TABLE. + -- Third party's job system token (if any). + maybe_kinovi_job_id VARCHAR(64) DEFAULT NULL, + -- ========== TIMESTAMPS ========== created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -49,6 +84,9 @@ CREATE TABLE characters ( UNIQUE KEY (token), KEY index_maybe_creator_user_token (maybe_creator_user_token), KEY index_is_active (is_active), + KEY index_kinovi_character_id (kinovi_character_id), + KEY index_maybe_generic_inference_job_token (maybe_generic_inference_job_token), + KEY index_maybe_kinovi_job_id (maybe_kinovi_job_id), KEY index_created_at (created_at), KEY index_deleted_at (deleted_at)