Compare commits

...
Author SHA1 Message Date
Brandon Thomas 33613cb5d8 insert batch generation records 2024-01-16 23:00:17 -05:00
Brandon Thomas 2487a8d646 refactor query modules 2024-01-16 21:03:56 -05:00
Brandon Thomas 1771e1dffe fix lint/test failures 2024-01-16 20:52:11 -05:00
Brandon Thomas 2d4d2c667f reference schemas 2024-01-16 19:49:08 -05:00
Brandon Thomas 0c99852dfd Merge pull request #278 from storytold/brandon-new-tables
new tables: idempotency_tokens, batch_generations; new column
2024-01-16 19:11:36 -05:00
Brandon Thomas 7cc310764e new tables: idempotency_tokens, batch_generations; new column 2024-01-16 19:10:23 -05:00
Kasisnu b66b04d86c Merge pull request #277 from storytold/jan-16-mithoo
bugfix: ignore more than one samples for zs
2024-01-16 13:06:48 +05:30
Kasisnu 18d46a0f57 bugfix: ignore more than one samples for zs 2024-01-16 13:06:29 +05:30
Kasisnu 97795fac22 Merge pull request #276 from storytold/jan-16-mithoo
codegen & styletts2 downloader cleanup
2024-01-16 11:40:30 +05:30
Kasisnu cec0cfc907 remove misleading downloaders from styletts2 2024-01-16 11:39:46 +05:30
Kasisnu d516058802 codegen 2024-01-16 11:36:28 +05:30
Kasisnu b77810cd29 Merge pull request #268 from storytold/jan-04-mithoo
adds styletts2 as voice designer model
2024-01-16 10:52:06 +05:30
Brandon Thomas 2507cf0332 analysis of AI streamer bug reports 2024-01-15 21:48:45 -05:00
Brandon Thomas cf4c335d41 migration tool for tts models 2024-01-15 21:27:44 -05:00
Kasisnu 5e98049c50 switch from vallex -> styletts2 for zero shot 2024-01-15 17:44:29 +05:30
Brandon Thomas 89cd104551 codegen 2024-01-13 22:58:39 -05:00
Brandon Thomas 5933387f5c tts_models migration: weights db column, list tts models 2024-01-13 22:49:14 -05:00
Brandon Thomas b5009d5985 bvh extension 2024-01-13 03:42:06 -05:00
Brandon Thomas de4548795c handle BVH file uploads 2024-01-13 03:38:17 -05:00
Brandon Thomas 6122f11cf3 Add MediaFileOriginDetails to list media files for user 2024-01-13 01:40:34 -05:00
Brandon Thomas 929105bb85 add color index to cover images 2024-01-13 01:22:31 -05:00
Brandon Thomas a76272aeb3 doc 2024-01-13 01:13:21 -05:00
Brandon Thomas 4c9cb5d986 add MediaFileOriginDetails to list featured media files 2024-01-13 01:12:04 -05:00
Brandon Thomas 108806cb52 list media files - MediaFileOriginDetails + title 2024-01-13 01:00:55 -05:00
Brandon Thomas ce852eda8a netlify feature branch cors 2024-01-12 15:51:50 -05:00
Kasisnu ea3a6d3c0b pass appropriate arguments to styletts inference command 2024-01-12 17:58:12 +05:30
Kasisnu c6a6676f08 adds styletts2 as voice designer model 2024-01-12 14:53:55 +05:30
Brandon Thomas 5949d1d4e7 fix names of search fields 2024-01-12 00:18:44 -05:00
Brandon Thomas c01ffe33a5 cover image details on all informational weight endpoints 2024-01-11 23:32:52 -05:00
Brandon Thomas f251e8b88a document types 2024-01-11 21:39:29 -05:00
Brandon Thomas 65ea06767a cover image details on list weights 2024-01-11 21:28:32 -05:00
Brandon Thomas 5643ecae89 CoverImageDetails 2024-01-11 21:16:10 -05:00
Brandon Thomas c1b152cc35 default cover images (part 1) 2024-01-11 20:56:37 -05:00
Brandon Thomas 65bdea264d move mod user_avatars 2024-01-11 20:34:13 -05:00
Brandon Thomas 0bca56a9db query bug - referenced old columns 2024-01-11 20:19:34 -05:00
Brandon Thomas 990f51bef0 fix failing tests and lints 2024-01-11 19:38:27 -05:00
Brandon Thomas c8be79c1dc change enum serialization 2024-01-11 19:15:55 -05:00
Brandon Thomas dca8ff7014 deprecated lint; clarify serde casing 2024-01-11 19:09:38 -05:00
Brandon Thomas d11c236257 analyze download jobs 2024-01-11 16:25:38 -05:00
Brandon Thomas 3a0246822f change token name for frontend 2024-01-11 15:57:17 -05:00
Brandon Thomas 690afa66d7 ugh, it was feature flagged 2024-01-11 05:48:03 -05:00
Brandon Thomas 0657880a9b this was 404ing, not sure why (too tired) 2024-01-11 05:21:16 -05:00
Brandon Thomas 792c109bb6 query exact indices in elasticsearch 2024-01-11 04:57:08 -05:00
Brandon Thomas 95987860f4 codegen 2024-01-11 02:30:17 -05:00
Brandon Thomas 6104782041 api docs for elasticsearch 2024-01-11 02:29:40 -05:00
Brandon Thomas b75dea434f model_weights elasticsearch endpoint 2024-01-11 02:23:42 -05:00
Brandon Thomas 3372447a0b cli elasticsearch search 2024-01-11 02:03:57 -05:00
Brandon Thomas 33323baf22 elasticsearch schema 2024-01-10 23:33:10 -05:00
Brandon Thomas 6e681b0ff6 Merge pull request #275 from storytold/brandon-es-wip
elasticsearch wip
2024-01-10 22:54:19 -05:00
Brandon Thomas aa1a007c5e elasticsearch wip 2024-01-10 22:53:36 -05:00
Brandon Thomas 590ef4701e codegen 2024-01-10 04:24:06 -05:00
Brandon Thomas 38d14ad361 stats on list weights (explore) 2024-01-10 04:22:33 -05:00
Brandon Thomas 8b63c7e5bc stats for get weight handler 2024-01-10 04:04:17 -05:00
Brandon Thomas ae80d5c02d clear out bookmark token if soft deleted (recommended by victor) 2024-01-10 03:38:47 -05:00
Brandon Thomas d3de1c9a4b add stats to list weights by user (remove old fields) 2024-01-10 03:32:56 -05:00
Brandon Thomas 70691437f3 add stats to featured weights handler 2024-01-10 03:05:22 -05:00
Brandon Thomas e63f4e08bf stats on list media for user handler 2024-01-10 02:39:52 -05:00
Brandon Thomas 0fae1229b6 stats on get media file endpoint 2024-01-10 02:34:43 -05:00
Brandon Thomas aae75c4050 fix batch bookmark bug 2024-01-10 02:21:37 -05:00
ArEnSc 19670459e8 Merge pull request #273 from storytold/feature/mocap-net
Add mocapnet
2024-01-10 00:34:18 -05:00
saltacc 240bf5f488 size arg & todo comment 2024-01-09 21:11:14 -08:00
Brandon Thomas b8c26fa9ce remove fields 2024-01-09 23:18:37 -05:00
Brandon Thomas 52d7e0585e Merge pull request #274 from storytold/brandon-more-stats-2
add stats on all endpoints
2024-01-09 23:12:22 -05:00
Brandon Thomas 9f54bfe0ab add stats on all endpoints 2024-01-09 23:11:24 -05:00
saltacc 7714f0c056 add command line arguments 2024-01-09 19:26:46 -08:00
saltacc dbdc5b3c9d fix directories, mime, and inference categories 2024-01-09 18:58:01 -08:00
saltacc c25cc3b126 add mocapnet 2024-01-09 16:21:32 -08:00
Brandon Thomas c07e71b8c3 add bookmark tokwn to batch get bookmarks 2024-01-09 00:35:29 -05:00
Brandon Thomas 0aaacdddaa reusable type 2024-01-08 23:30:16 -05:00
Brandon Thomas 52af33a94d stats on list bookmarks for user endpoint 2024-01-08 23:25:49 -05:00
Brandon Thomas 7900d732c7 codegen queries 2024-01-08 00:31:34 -05:00
Brandon Thomas af24c8d469 Merge pull request #270 from storytold/brandon-ratings-counts
collect rating stats
2024-01-08 00:30:41 -05:00
Brandon Thomas de768158ab collect rating stats 2024-01-08 00:29:52 -05:00
Brandon Thomas 1237aa8a10 rename create -> upsert 2024-01-07 23:14:47 -05:00
Brandon Thomas f601c4a385 codegen DB, comment 2024-01-06 09:57:30 -05:00
Brandon Thomas d03c53ed2e fix logic on delete, too 2024-01-05 23:59:06 -05:00
Brandon Thomas cd0c35de4a fix increment logic 2024-01-05 23:54:13 -05:00
Brandon Thomas 39a5440b81 Merge pull request #269 from storytold/brandon-record-stats
record stats
2024-01-05 23:37:16 -05:00
Brandon Thomas 12f59916b6 record stats 2024-01-05 23:34:12 -05:00
Brandon Thomas 4489ffb95e Merge pull request #267 from storytold/brandon-stats-table
remove stats from model_weights, add a stats side table
2024-01-04 01:59:35 -05:00
Brandon Thomas 733fb9bf53 Drop stats info from model weights (we'll do a JOIN soon) 2024-01-04 01:49:53 -05:00
Brandon Thomas 79cbeaffe0 stats table 2024-01-04 01:10:32 -05:00
Brandon Thomas 6aef6fa99e Merge pull request #265 from storytold/brandon-batch-get-user-bookmarks
batch get user bookmarks
2024-01-03 05:04:08 -05:00
Brandon Thomas 205ac37c3d batch get user bookmarks 2024-01-03 05:03:27 -05:00
Brandon Thomas cd02103457 prevent abuse of endpoint 2024-01-03 04:33:12 -05:00
Brandon Thomas 46f184483f Merge pull request #264 from storytold/brandon-batch-get-user-ratings
batch get user ratings
2024-01-03 04:07:44 -05:00
Brandon Thomas ecd1a12438 batch get user ratings 2024-01-03 04:06:54 -05:00
Brandon Thomas ad7b69030b Merge pull request #263 from storytold/brandon-report-rating-count-on-rating
report rating count on rating
2024-01-03 01:21:16 -05:00
Brandon Thomas cd583e3b91 report rating count on rating 2024-01-03 01:07:47 -05:00
Brandon Thomas 291b4a2ff9 Merge pull request #262 from storytold/brandon-bookmark-count-on-add
return bookmark count after adding or removing a bookmark
2024-01-03 00:00:19 -05:00
Brandon Thomas c4017370bf return bookmark count after adding or removing a bookmark 2024-01-02 23:09:46 -05:00
Brandon Thomas d120489daf featured media files model metadata 2024-01-01 23:24:15 -05:00
Brandon Thomas 0c1f4ff0e3 Merge pull request #261 from storytold/brandon-strong-types-list-available-weights
strong types on list available weights
2024-01-01 23:14:33 -05:00
Brandon Thomas 32df84a8ce strong types on list available weights 2024-01-01 23:14:00 -05:00
Brandon Thomas 2ea38f0ff4 rename response fields to be in line with others 2023-12-31 00:41:57 -05:00
Brandon Thomas 993d60a746 Merge pull request #260 from storytold/brandon-list-weight-by-user-query-scoping
scope queries on list weight by user
2023-12-30 23:58:26 -05:00
Brandon Thomas e4ae6c0af2 scope queries on list weight by user 2023-12-30 23:57:58 -05:00
Brandon Thomas 88610b2c58 unused variables lint 2023-12-30 23:19:44 -05:00
Brandon Thomas 9d94737737 fix lint, add new lint (unused parens) 2023-12-30 20:29:25 -05:00
Brandon Thomas 4cf4c3c5a2 Merge pull request #259 from storytold/brandon-bookmarks-creators
add creator details to user bookmarks (for weights, media files)
2023-12-30 02:32:51 -05:00
Brandon Thomas 3c1cba1fad add creator details to user bookmarks (for weights, media files) 2023-12-30 02:31:33 -05:00
Brandon Thomas 1bf58b01e1 Merge pull request #257 from storytold/brandon-rename-weights-fields
rename singular "weights_*" fields to "weight_*"
2023-12-29 12:07:33 -05:00
Brandon Thomas 66594ce8f5 rename singular "weights_*" fields to "weight_*" 2023-12-29 12:07:10 -05:00
Brandon Thomas 03bed40e57 fix broken query 2023-12-29 00:45:06 -05:00
Brandon Thomas ab7afcfb72 Merge pull request #256 from storytold/brandon-get-weight-creator-and-cover
get weight - add creator + cover for model weights; rename fields
2023-12-28 23:09:46 -05:00
Brandon Thomas b331cc999c get weight - add creator + cover for model weights; rename fields 2023-12-28 23:08:54 -05:00
Brandon Thomas dbd91dd67f Merge pull request #255 from storytold/brandon-update-weight-cover-image
update weight cover image in update endpoint
2023-12-28 22:26:10 -05:00
Brandon Thomas b0ed202c6a update weight cover image in update endpoint 2023-12-28 22:25:14 -05:00
Brandon Thomas 556454ce9c Merge pull request #254 from storytold/brandon-bookmark-media-file-info
media file info (path, type) on bookmarks
2023-12-28 21:08:44 -05:00
Brandon Thomas 5d49f5c4e4 media file info (path, type) on bookmarks 2023-12-28 21:08:16 -05:00
Brandon Thomas 23daee1272 codegen db 2023-12-28 20:12:28 -05:00
Brandon Thomas 3deeaf8803 Merge pull request #253 from storytold/brandon-add-cover-to-bookmarks
add cover to bookmark model weights
2023-12-28 20:11:12 -05:00
Brandon Thomas f0879a5241 add cover to bookmark model weights 2023-12-28 20:10:39 -05:00
Brandon Thomas 5be341f5fc Merge pull request #252 from storytold/brandon-fix-weight-auth
fix get weight auth
2023-12-28 19:39:55 -05:00
Brandon Thomas 186622cedd fix get weight auth 2023-12-28 19:39:26 -05:00
Brandon Thomas 1db9fd7a2a Merge pull request #251 from storytold/brandon-get-media-file-model-info
model info on get media file
2023-12-28 19:23:15 -05:00
Brandon Thomas e5f21f26c8 model info on get media file 2023-12-28 19:22:21 -05:00
Brandon Thomas a37dc7d498 update docs 2023-12-28 18:32:40 -05:00
Brandon Thomas b9b5051a99 Merge pull request #250 from storytold/brandon-add-bookmark-model-data
add model data to bookmark results
2023-12-28 16:36:07 -05:00
Brandon Thomas e0f0a3dd92 add model data to bookmark results 2023-12-28 16:33:14 -05:00
Brandon Thomas adee3d577d Merge pull request #249 from storytold/brandon-add-bookmark-query-filters
bookmark query filters
2023-12-28 16:11:51 -05:00
Brandon Thomas 97335b2233 bookmark query filters 2023-12-28 16:10:33 -05:00
Brandon Thomas 779b171208 download job analytics 2023-12-28 15:40:01 -05:00
Brandon Thomas 17e5641a00 Merge pull request #248 from storytold/dec-27-mithoo
weights & media files list endpoints respect visibility
2023-12-27 18:13:49 -05:00
Kasisnu afa91c032e fix typos in ratings endpoints docs 2023-12-27 16:43:07 +05:30
Kasisnu a76807ab7d document user rating endpoint 2023-12-27 16:32:09 +05:30
Kasisnu 15c1cb8e5e list weights/endpoints return public/private results based on user session 2023-12-27 16:04:10 +05:30
Kasisnu 4a69589f1d Merge pull request #247 from storytold/dec-26-mithoo
minor query builder updates for editing weights and paginatinating weights explore
2023-12-27 11:55:16 +05:30
Kasisnu ed72cf7f7f rename per_page -> page_size for consistency 2023-12-27 11:54:30 +05:30
Kasisnu ad093d3fa8 explore weights query builder offset 2023-12-26 20:02:39 +05:30
Kasisnu b505896864 update weights w/query builder 2023-12-26 16:16:47 +05:30
Brandon Thomas b680002c6b fix download job 2023-12-24 03:22:50 -05:00
Brandon Thomas 40bb91f024 fix lints 2023-12-24 02:42:58 -05:00
Brandon Thomas fa002d3fe3 Merge pull request #245 from storytold/brandon-make-model-weights-descriptions-optional
make model_weights descriptions optional
2023-12-24 02:25:12 -05:00
Brandon Thomas 02bec3655c make model_weights descriptions optional
- these will be bad to have on low-value weights, eg. zero shot.
- want to capture this change now
2023-12-24 02:24:20 -05:00
Brandon Thomas 12b7f4d25e fix broken download job query 2023-12-24 01:40:20 -05:00
Brandon Thomas 02d6f6c940 fix a class of model download failures 2023-12-24 01:24:58 -05:00
Brandon Thomas f5d7c93c22 media file scoping query bug fix 2023-12-23 23:46:03 -05:00
ArEnSc 0125eba7cc Merge pull request #244 from storytold/feature/missing-response-values
Fixed added weights type by request.
2023-12-23 23:26:49 -05:00
ArEnSc 033e42d1b1 Merge pull request #243 from storytold/feature/missing-response-values
Add missing data in response
2023-12-23 15:02:13 -05:00
Brandon Thomas aa0632bd41 Merge pull request #242 from storytold/dec-21-mithoo
media files pagination fix
2023-12-22 14:11:41 -05:00
Brandon Thomas 87cc49982e model weights es document 2023-12-22 12:57:50 -05:00
Brandon Thomas 853943f21a mimetype reuse 2023-12-22 11:01:21 -05:00
Kasisnu 6f9dd4d6e3 make user bookmarks pagination consistent with media/weights 2023-12-22 18:15:29 +05:30
Kasisnu 5de56cd11b make public weights & media list behave similarly wrt pagination 2023-12-22 13:14:31 +05:30
Kasisnu df16a4aa89 media files pagination fix 2023-12-22 13:06:30 +05:30
Brandon Thomas 613289f1ab update docs 2023-12-21 23:41:37 -05:00
Brandon Thomas ae49b9da7d fix image uploads 2023-12-21 23:16:15 -05:00
Brandon Thomas 3f531ae9f0 API doc, fix field name 2023-12-21 23:08:13 -05:00
Brandon Thomas 370bcf3f2d Merge pull request #241 from storytold/brandon-rename-avatar-to-cover
rename avatar to cover_image
2023-12-21 22:54:15 -05:00
Brandon Thomas 685264e20c fix seeding; codegen 2023-12-21 22:53:28 -05:00
Brandon Thomas 2c7400bf76 update code references (avatar -> cover_image) 2023-12-21 22:49:44 -05:00
Brandon Thomas fae36d485b migrations to simplify media files on a model 2023-12-21 22:26:41 -05:00
Brandon Thomas fe3107b1b0 fix lints/tests failures 2023-12-21 22:11:00 -05:00
Brandon Thomas bdde5da223 Merge pull request #240 from storytold/brandon-more-avatar-images
more "avatar" images on weights
2023-12-21 21:06:27 -05:00
Brandon Thomas 7539237ee4 more "avatar" images on weights 2023-12-21 21:05:14 -05:00
349 changed files with 11556 additions and 3305 deletions
@@ -1,6 +1,6 @@
{
"db_name": "MySQL",
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_thumbnail_token,\n wt.description_markdown,\n wt.description_rendered_html,\n\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash AS creator_gravatar_hash,\n\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n avatar.public_bucket_directory_hash as maybe_avatar_public_bucket_hash,\n avatar.maybe_public_bucket_prefix as maybe_avatar_public_bucket_prefix,\n avatar.maybe_public_bucket_extension as maybe_avatar_public_bucket_extension,\n\n wt.cached_user_ratings_negative_count,\n wt.cached_user_ratings_positive_count,\n wt.cached_user_ratings_total_count,\n wt.maybe_cached_user_ratings_ratio,\n wt.cached_user_ratings_last_updated_at,\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n FROM model_weights as wt\n JOIN users\n ON users.token = wt.creator_user_token\n LEFT OUTER JOIN media_files as avatar\n ON avatar.token = wt.maybe_avatar_media_file_token\n WHERE\n wt.token = ?\n ",
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_description_markdown,\n wt.maybe_description_rendered_html,\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash AS creator_gravatar_hash,\n\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n cover_image.public_bucket_directory_hash as maybe_cover_image_public_bucket_hash,\n cover_image.maybe_public_bucket_prefix as maybe_cover_image_public_bucket_prefix,\n cover_image.maybe_public_bucket_extension as maybe_cover_image_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n FROM model_weights as wt\n JOIN users\n ON users.token = wt.creator_user_token\n LEFT OUTER JOIN media_files as cover_image\n ON cover_image.token = wt.maybe_cover_image_media_file_token\n LEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"model_weight\"\n AND entity_stats.entity_token = wt.token\n WHERE\n wt.token = ?\n AND wt.user_deleted_at IS NULL\n AND wt.mod_deleted_at IS NULL\n ",
"describe": {
"columns": [
{
@@ -45,76 +45,26 @@
},
{
"ordinal": 4,
"name": "maybe_thumbnail_token",
"name": "maybe_description_markdown",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"type": "Blob",
"flags": "BLOB | BINARY",
"char_set": 224,
"max_size": 128
"max_size": 262140
}
},
{
"ordinal": 5,
"name": "description_markdown",
"name": "maybe_description_rendered_html",
"type_info": {
"type": "Blob",
"flags": "NOT_NULL | BLOB | BINARY | NO_DEFAULT_VALUE",
"flags": "BLOB | BINARY",
"char_set": 224,
"max_size": 262140
}
},
{
"ordinal": 6,
"name": "description_rendered_html",
"type_info": {
"type": "Blob",
"flags": "NOT_NULL | BLOB | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 262140
}
},
{
"ordinal": 7,
"name": "creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 8,
"name": "creator_username",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 9,
"name": "creator_display_name",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 10,
"name": "creator_gravatar_hash",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 11,
"name": "creator_ip_address",
"type_info": {
"type": "VarString",
@@ -124,7 +74,7 @@
}
},
{
"ordinal": 12,
"ordinal": 7,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
@@ -134,7 +84,47 @@
}
},
{
"ordinal": 13,
"ordinal": 8,
"name": "creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 9,
"name": "creator_username",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 10,
"name": "creator_display_name",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 11,
"name": "creator_gravatar_hash",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 12,
"name": "maybe_last_update_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
@@ -144,7 +134,7 @@
}
},
{
"ordinal": 14,
"ordinal": 13,
"name": "original_download_url",
"type_info": {
"type": "VarString",
@@ -154,7 +144,7 @@
}
},
{
"ordinal": 15,
"ordinal": 14,
"name": "original_filename",
"type_info": {
"type": "VarString",
@@ -164,7 +154,7 @@
}
},
{
"ordinal": 16,
"ordinal": 15,
"name": "file_size_bytes",
"type_info": {
"type": "Long",
@@ -174,7 +164,7 @@
}
},
{
"ordinal": 17,
"ordinal": 16,
"name": "file_checksum_sha2",
"type_info": {
"type": "String",
@@ -184,7 +174,7 @@
}
},
{
"ordinal": 18,
"ordinal": 17,
"name": "public_bucket_hash",
"type_info": {
"type": "VarString",
@@ -194,7 +184,7 @@
}
},
{
"ordinal": 19,
"ordinal": 18,
"name": "maybe_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -204,7 +194,7 @@
}
},
{
"ordinal": 20,
"ordinal": 19,
"name": "maybe_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -214,8 +204,8 @@
}
},
{
"ordinal": 21,
"name": "maybe_avatar_public_bucket_hash",
"ordinal": 20,
"name": "maybe_cover_image_public_bucket_hash",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
@@ -223,9 +213,19 @@
"max_size": 128
}
},
{
"ordinal": 21,
"name": "maybe_cover_image_public_bucket_prefix",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 22,
"name": "maybe_avatar_public_bucket_prefix",
"name": "maybe_cover_image_public_bucket_extension",
"type_info": {
"type": "VarString",
"flags": "BINARY",
@@ -235,66 +235,36 @@
},
{
"ordinal": 23,
"name": "maybe_avatar_public_bucket_extension",
"name": "maybe_ratings_positive_count",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 24,
"name": "cached_user_ratings_negative_count",
"name": "maybe_ratings_negative_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 25,
"name": "cached_user_ratings_positive_count",
"name": "maybe_bookmark_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 26,
"name": "cached_user_ratings_total_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 27,
"name": "maybe_cached_user_ratings_ratio",
"type_info": {
"type": "Float",
"flags": "",
"char_set": 63,
"max_size": 12
}
},
{
"ordinal": 28,
"name": "cached_user_ratings_last_updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 29,
"name": "version",
"type_info": {
"type": "Long",
@@ -304,7 +274,7 @@
}
},
{
"ordinal": 30,
"ordinal": 27,
"name": "created_at",
"type_info": {
"type": "Timestamp",
@@ -314,7 +284,7 @@
}
},
{
"ordinal": 31,
"ordinal": 28,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
@@ -324,7 +294,7 @@
}
},
{
"ordinal": 32,
"ordinal": 29,
"name": "user_deleted_at",
"type_info": {
"type": "Timestamp",
@@ -334,7 +304,7 @@
}
},
{
"ordinal": 33,
"ordinal": 30,
"name": "mod_deleted_at",
"type_info": {
"type": "Timestamp",
@@ -353,8 +323,7 @@
false,
false,
true,
false,
false,
true,
false,
false,
false,
@@ -372,11 +341,9 @@
true,
true,
true,
false,
false,
false,
true,
false,
true,
true,
false,
false,
false,
@@ -384,5 +351,5 @@
true
]
},
"hash": "4e30e34cdf7a5834a3981d5e634506966bac9f9c420e800d15ce313778272cee"
"hash": "0220f288c06686874df87ec163533be64cc000634920d58e7fa7a7d156cbfcae"
}
@@ -0,0 +1,300 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n m.token as `token: tokens::tokens::media_files::MediaFileToken`,\n\n m.media_type as `media_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n\n users.token as `maybe_creator_user_token: tokens::tokens::users::UserToken`,\n users.username as maybe_creator_username,\n users.display_name as maybe_creator_display_name,\n users.email_gravatar_hash as maybe_creator_gravatar_hash,\n\n m.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n model_weights.token as `maybe_model_weights_token: tokens::tokens::model_weights::ModelWeightToken`,\n model_weights.title as maybe_model_weights_title,\n model_weights.weights_type as `maybe_model_weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n model_weights.weights_category as `maybe_model_weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n\n cover_image.public_bucket_directory_hash as maybe_model_cover_image_public_bucket_hash,\n cover_image.maybe_public_bucket_prefix as maybe_model_cover_image_public_bucket_prefix,\n cover_image.maybe_public_bucket_extension as maybe_model_cover_image_public_bucket_extension,\n\n model_weight_creator.token as `maybe_model_weight_creator_user_token: tokens::tokens::users::UserToken`,\n model_weight_creator.username as maybe_model_weight_creator_username,\n model_weight_creator.display_name as maybe_model_weight_creator_display_name,\n model_weight_creator.email_gravatar_hash as maybe_model_weight_creator_gravatar_hash,\n\n m.public_bucket_directory_hash,\n m.maybe_public_bucket_prefix,\n m.maybe_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n\n m.created_at,\n m.updated_at\n\nFROM media_files AS m\nLEFT OUTER JOIN users\n ON m.maybe_creator_user_token = users.token\nLEFT OUTER JOIN model_weights\n ON m.maybe_origin_model_token = model_weights.token\nLEFT OUTER JOIN media_files as cover_image\n ON cover_image.token = model_weights.maybe_cover_image_media_file_token\nLEFT OUTER JOIN users as model_weight_creator\n ON model_weight_creator.token = model_weights.creator_user_token\nLEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"media_file\"\n AND entity_stats.entity_token = m.token\nWHERE\n m.token = ?\n AND m.user_deleted_at IS NULL\n AND m.mod_deleted_at IS NULL\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token: tokens::tokens::media_files::MediaFileToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 1,
"name": "media_type: enums::by_table::media_files::media_file_type::MediaFileType",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 2,
"name": "maybe_creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 3,
"name": "maybe_creator_username",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 4,
"name": "maybe_creator_display_name",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 5,
"name": "maybe_creator_gravatar_hash",
"type_info": {
"type": "String",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 6,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | ENUM",
"char_set": 224,
"max_size": 28
}
},
{
"ordinal": 7,
"name": "maybe_model_weights_token: tokens::tokens::model_weights::ModelWeightToken",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 8,
"name": "maybe_model_weights_title",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 9,
"name": "maybe_model_weights_type: enums::by_table::model_weights::weights_types::WeightsType",
"type_info": {
"type": "VarString",
"flags": "MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 10,
"name": "maybe_model_weights_category: enums::by_table::model_weights::weights_category::WeightsCategory",
"type_info": {
"type": "VarString",
"flags": "MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 11,
"name": "maybe_model_cover_image_public_bucket_hash",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 12,
"name": "maybe_model_cover_image_public_bucket_prefix",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 13,
"name": "maybe_model_cover_image_public_bucket_extension",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 14,
"name": "maybe_model_weight_creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 15,
"name": "maybe_model_weight_creator_username",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 16,
"name": "maybe_model_weight_creator_display_name",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 17,
"name": "maybe_model_weight_creator_gravatar_hash",
"type_info": {
"type": "String",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 18,
"name": "public_bucket_directory_hash",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 19,
"name": "maybe_public_bucket_prefix",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 20,
"name": "maybe_public_bucket_extension",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 21,
"name": "maybe_ratings_positive_count",
"type_info": {
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 22,
"name": "maybe_ratings_negative_count",
"type_info": {
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 23,
"name": "maybe_bookmark_count",
"type_info": {
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 24,
"name": "created_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 25,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP | ON_UPDATE_NOW",
"char_set": 63,
"max_size": 19
}
}
],
"parameters": {
"Right": 1
},
"nullable": [
false,
false,
true,
true,
true,
true,
false,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
false,
true,
true,
true,
true,
true,
false,
false
]
},
"hash": "06e0c5e80803d072551bc4df40e7d273ba0772608d52b46b840249415c341945"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\nINSERT INTO model_weights_extension_tts_details\nSET\n model_weights_token = ?,\n ietf_language_tag = ?,\n ietf_primary_language_subtag = ?,\n text_pipeline_type = ?,\n use_default_mel_multiply_factor = ?,\n maybe_custom_mel_multiply_factor = ?,\n maybe_default_pretrained_vocoder = ?,\n maybe_custom_vocoder_token = ?\nON DUPLICATE KEY UPDATE\n ietf_language_tag = ?,\n ietf_primary_language_subtag = ?,\n text_pipeline_type = ?,\n use_default_mel_multiply_factor = ?,\n maybe_custom_mel_multiply_factor = ?,\n maybe_default_pretrained_vocoder = ?,\n maybe_custom_vocoder_token = ?\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 15
},
"nullable": []
},
"hash": "1ce9219b8f05fe54adaa6841acb708e165e1c7855b441b9623a2151197578929"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\n INSERT INTO entity_stats SET\n entity_type = ?,\n entity_token = ?,\n ratings_positive_count = 0,\n ratings_negative_count = 1\n ON DUPLICATE KEY UPDATE\n ratings_positive_count = ABS(CAST(ratings_positive_count AS SIGNED) - 1),\n ratings_negative_count = ratings_negative_count + 1\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "1d6c0e4b9c19d0726270e52cfd128f2a9068aa58465e86716c7476c8635f9762"
}
@@ -1,212 +0,0 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n f.token as `token: tokens::tokens::user_bookmarks::UserBookmarkToken`,\n f.entity_type as `entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType`,\n f.entity_token,\n f.user_token as `user_token: tokens::tokens::users::UserToken`,\n u.username,\n u.display_name as user_display_name,\n u.email_gravatar_hash as user_gravatar_hash,\n f.created_at,\n f.updated_at,\n f.deleted_at,\n\n media_files.media_type as `maybe_media_file_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n media_files.origin_product_category as `maybe_media_file_origin_category: enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory`,\n\n model_weights.title as maybe_descriptive_text_model_weight_title,\n tts_models.title as maybe_descriptive_text_tts_model_title,\n tts_results.raw_inference_text as maybe_descriptive_text_tts_result_inference_text,\n users.display_name as maybe_descriptive_text_user_display_name,\n voice_conversion_models.title as maybe_descriptive_text_voice_conversion_model_title,\n zs_voices.title as maybe_descriptive_text_zs_voice_title\n\nFROM\n user_bookmarks AS f\nJOIN users AS u\n ON f.user_token = u.token\n\nLEFT OUTER JOIN model_weights ON model_weights.token = f.entity_token\nLEFT OUTER JOIN media_files ON media_files.token = f.entity_token\nLEFT OUTER JOIN tts_models ON tts_models.token = f.entity_token\nLEFT OUTER JOIN tts_results ON tts_results.token = f.entity_token\nLEFT OUTER JOIN users ON users.token = f.entity_token\nLEFT OUTER JOIN voice_conversion_models ON voice_conversion_models.token = f.entity_token\nLEFT OUTER JOIN zs_voices ON zs_voices.token = f.entity_token\n\nWHERE\n u.username = ?\n AND f.entity_type = ?\n AND f.deleted_at IS NULL\nORDER BY f.id DESC\nLIMIT 50\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token: tokens::tokens::user_bookmarks::UserBookmarkToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 1,
"name": "entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 2,
"name": "entity_token",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 3,
"name": "user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 4,
"name": "username",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 5,
"name": "user_display_name",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 6,
"name": "user_gravatar_hash",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 7,
"name": "created_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 8,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP | ON_UPDATE_NOW",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 9,
"name": "deleted_at",
"type_info": {
"type": "Timestamp",
"flags": "MULTIPLE_KEY | BINARY",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 10,
"name": "maybe_media_file_type: enums::by_table::media_files::media_file_type::MediaFileType",
"type_info": {
"type": "VarString",
"flags": "MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 11,
"name": "maybe_media_file_origin_category: enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory",
"type_info": {
"type": "VarString",
"flags": "MULTIPLE_KEY | BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 12,
"name": "maybe_descriptive_text_model_weight_title",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 13,
"name": "maybe_descriptive_text_tts_model_title",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 14,
"name": "maybe_descriptive_text_tts_result_inference_text",
"type_info": {
"type": "Blob",
"flags": "BLOB | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 262140
}
},
{
"ordinal": 15,
"name": "maybe_descriptive_text_user_display_name",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 16,
"name": "maybe_descriptive_text_voice_conversion_model_title",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 17,
"name": "maybe_descriptive_text_zs_voice_title",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
}
],
"parameters": {
"Right": 2
},
"nullable": [
false,
false,
false,
false,
false,
false,
false,
false,
false,
true,
true,
true,
true,
true,
true,
true,
true,
true
]
},
"hash": "3a7ac7f979ac270dad1070031d0d663d0eb3d969365f6b2fd048ca41c5c455b2"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\n INSERT INTO entity_stats SET\n entity_type = ?,\n entity_token = ?,\n bookmark_count = 1\n ON DUPLICATE KEY UPDATE\n bookmark_count = bookmark_count + 1\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "3cfd6ff9a99be15f4a90a710d147291e5f62487c88a5c5bbbbd1fb2c1780a4d5"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\n INSERT INTO entity_stats SET\n entity_type = ?,\n entity_token = ?,\n ratings_negative_count = 1\n ON DUPLICATE KEY UPDATE\n ratings_negative_count = ratings_negative_count + 1\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "40cb263656c235549e5d69c2e66fa28b9feb966a8092583b8ffc26ae59cef1f6"
}
@@ -1,11 +1,11 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n m.token as `token: tokens::tokens::media_files::MediaFileToken`,\n\n m.media_type as `media_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n\n users.token as `maybe_creator_user_token: tokens::tokens::users::UserToken`,\n users.username as maybe_creator_username,\n users.display_name as maybe_creator_display_name,\n users.email_gravatar_hash as maybe_creator_gravatar_hash,\n\n m.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n m.public_bucket_directory_hash,\n m.maybe_public_bucket_prefix,\n m.maybe_public_bucket_extension,\n\n m.created_at,\n m.updated_at\n\nFROM media_files AS m\nLEFT OUTER JOIN users\n ON m.maybe_creator_user_token = users.token\nWHERE\n m.token = ?\n AND m.user_deleted_at IS NULL\n AND m.mod_deleted_at IS NULL\n ",
"query": "\nSELECT\n w.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n w.weights_type as `weight_type: enums::by_table::model_weights::weights_types::WeightsType`,\n w.title,\n w.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash as creator_gravatar_hash,\n w_extension.ietf_language_tag,\n w_extension.ietf_primary_language_subtag,\n w.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n w.created_at,\n w.updated_at\nFROM model_weights as w\nLEFT OUTER JOIN model_weights_extension_tts_details as w_extension\n ON w_extension.model_weights_token = w.token\nJOIN users\n ON users.token = w.creator_user_token\nWHERE\n w.weights_type IN (\"tt2\")\n AND w.user_deleted_at IS NULL\n AND w.mod_deleted_at IS NULL\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token: tokens::tokens::media_files::MediaFileToken",
"name": "token: tokens::tokens::model_weights::ModelWeightToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
@@ -15,92 +15,92 @@
},
{
"ordinal": 1,
"name": "media_type: enums::by_table::media_files::media_file_type::MediaFileType",
"name": "weight_type: enums::by_table::model_weights::weights_types::WeightsType",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 2,
"name": "maybe_creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 3,
"name": "maybe_creator_username",
"ordinal": 2,
"name": "title",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
"max_size": 1020
}
},
{
"ordinal": 3,
"name": "creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 4,
"name": "maybe_creator_display_name",
"name": "creator_username",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 5,
"name": "maybe_creator_gravatar_hash",
"name": "creator_display_name",
"type_info": {
"type": "String",
"flags": "BINARY | NO_DEFAULT_VALUE",
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
"max_size": 80
}
},
{
"ordinal": 6,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"name": "creator_gravatar_hash",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | ENUM",
"char_set": 224,
"max_size": 28
}
},
{
"ordinal": 7,
"name": "public_bucket_directory_hash",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 8,
"name": "maybe_public_bucket_prefix",
"ordinal": 7,
"name": "ietf_language_tag",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
"max_size": 256
}
},
{
"ordinal": 8,
"name": "ietf_primary_language_subtag",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 48
}
},
{
"ordinal": 9,
"name": "maybe_public_bucket_extension",
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"type": "String",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | ENUM",
"char_set": 224,
"max_size": 64
"max_size": 28
}
},
{
@@ -125,22 +125,22 @@
}
],
"parameters": {
"Right": 1
"Right": 0
},
"nullable": [
false,
false,
true,
true,
true,
true,
false,
false,
false,
false,
false,
true,
true,
false,
false,
false
]
},
"hash": "afdbb01a3efc9bcf283d0c8888995673b9f50588788a44f004d3ae4f330092ef"
"hash": "4d45f5ce213627465e991eaec9b509100e22c614367b67ab026b5edd70927ea5"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\n INSERT INTO entity_stats SET\n entity_type = ?,\n entity_token = ?,\n ratings_positive_count = 1,\n ratings_negative_count = 0\n ON DUPLICATE KEY UPDATE\n ratings_positive_count = ratings_positive_count + 1,\n ratings_negative_count = ABS(CAST(ratings_negative_count AS SIGNED) - 1)\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "5a7186c39fff3fee762918b33eb0081cec0a58f62b24f0b717bb9ff1f848d9b2"
}
@@ -1,10 +1,20 @@
{
"db_name": "MySQL",
"query": "\n SELECT \n mw.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n mw.title,\n mw.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n mw.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n mw.maybe_thumbnail_token,\n mw.description_markdown,\n mw.description_rendered_html,\n users.token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash as creator_email_gravatar_hash,\n mw.creator_ip_address,\n mw.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n mw.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n mw.original_download_url,\n mw.original_filename,\n mw.file_size_bytes,\n mw.file_checksum_sha2,\n mw.public_bucket_hash,\n mw.maybe_public_bucket_prefix,\n mw.maybe_public_bucket_extension,\n mw.cached_user_ratings_negative_count,\n mw.cached_user_ratings_positive_count,\n mw.cached_user_ratings_total_count,\n mw.maybe_cached_user_ratings_ratio,\n mw.cached_user_ratings_last_updated_at,\n mw.version,\n mw.created_at,\n mw.updated_at,\n mw.user_deleted_at,\n mw.mod_deleted_at\n FROM model_weights as mw\n JOIN users\n ON users.token = mw.creator_user_token\n WHERE\n users.username = ?\n ",
"query": "\nSELECT\n w.id,\n w.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n\n w.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n w.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n w.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n\n w.title,\n\n cover_image.token as `maybe_cover_image_media_file_token: tokens::tokens::media_files::MediaFileToken`,\n cover_image.public_bucket_directory_hash as maybe_cover_image_public_bucket_hash,\n cover_image.maybe_public_bucket_prefix as maybe_cover_image_public_bucket_prefix,\n cover_image.maybe_public_bucket_extension as maybe_cover_image_public_bucket_extension,\n\n w.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash as creator_gravatar_hash,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n\n extension_tts.ietf_language_tag as maybe_tts_ietf_language_tag,\n extension_tts.ietf_primary_language_subtag as maybe_tts_ietf_primary_language_subtag,\n\n extension_vc.ietf_language_tag as maybe_vc_ietf_language_tag,\n extension_vc.ietf_primary_language_subtag as maybe_vc_ietf_primary_language_subtag,\n\n w.created_at,\n w.updated_at,\n w.user_deleted_at,\n w.mod_deleted_at\n\nFROM model_weights as w\n\nJOIN users\n ON users.token = w.creator_user_token\n\nLEFT OUTER JOIN model_weights_extension_tts_details as extension_tts\n ON extension_tts.model_weights_token = w.token\nLEFT OUTER JOIN model_weights_extension_voice_conversion_details as extension_vc\n ON extension_vc.model_weights_token = w.token\nLEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"model_weights\"\n AND entity_stats.entity_token = w.token\nLEFT OUTER JOIN media_files as cover_image\n ON cover_image.token = w.maybe_cover_image_media_file_token\n\nWHERE\n w.id > ?\nORDER BY id ASC\nLIMIT ?\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": {
"type": "LongLong",
"flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT",
"char_set": 63,
"max_size": 20
}
},
{
"ordinal": 1,
"name": "token: tokens::tokens::model_weights::ModelWeightToken",
"type_info": {
"type": "VarString",
@@ -13,118 +23,8 @@
"max_size": 128
}
},
{
"ordinal": 1,
"name": "title",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 2,
"name": "weights_type: enums::by_table::model_weights::weights_types::WeightsType",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 3,
"name": "weights_category: enums::by_table::model_weights::weights_category::WeightsCategory",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 4,
"name": "maybe_thumbnail_token",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 5,
"name": "description_markdown",
"type_info": {
"type": "Blob",
"flags": "NOT_NULL | BLOB | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 262140
}
},
{
"ordinal": 6,
"name": "description_rendered_html",
"type_info": {
"type": "Blob",
"flags": "NOT_NULL | BLOB | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 262140
}
},
{
"ordinal": 7,
"name": "creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 8,
"name": "creator_username",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 9,
"name": "creator_display_name",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 10,
"name": "creator_email_gravatar_hash",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 11,
"name": "creator_ip_address",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 160
}
},
{
"ordinal": 12,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
@@ -134,147 +34,187 @@
}
},
{
"ordinal": 13,
"name": "maybe_last_update_user_token: tokens::tokens::users::UserToken",
"ordinal": 3,
"name": "weights_type: enums::by_table::model_weights::weights_types::WeightsType",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 4,
"name": "weights_category: enums::by_table::model_weights::weights_category::WeightsCategory",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 5,
"name": "title",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 6,
"name": "maybe_cover_image_media_file_token: tokens::tokens::media_files::MediaFileToken",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 7,
"name": "maybe_cover_image_public_bucket_hash",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 8,
"name": "maybe_cover_image_public_bucket_prefix",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 9,
"name": "maybe_cover_image_public_bucket_extension",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 10,
"name": "creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 11,
"name": "creator_username",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 12,
"name": "creator_display_name",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 13,
"name": "creator_gravatar_hash",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 14,
"name": "original_download_url",
"name": "maybe_ratings_positive_count",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 2048
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 15,
"name": "original_filename",
"name": "maybe_ratings_negative_count",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 1020
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 16,
"name": "file_size_bytes",
"name": "maybe_bookmark_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 17,
"name": "file_checksum_sha2",
"name": "maybe_tts_ietf_language_tag",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 256
}
},
{
"ordinal": 18,
"name": "public_bucket_hash",
"name": "maybe_tts_ietf_primary_language_subtag",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"flags": "BINARY",
"char_set": 224,
"max_size": 128
"max_size": 48
}
},
{
"ordinal": 19,
"name": "maybe_public_bucket_prefix",
"name": "maybe_vc_ietf_language_tag",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
"max_size": 256
}
},
{
"ordinal": 20,
"name": "maybe_public_bucket_extension",
"name": "maybe_vc_ietf_primary_language_subtag",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
"max_size": 48
}
},
{
"ordinal": 21,
"name": "cached_user_ratings_negative_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 22,
"name": "cached_user_ratings_positive_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 23,
"name": "cached_user_ratings_total_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 24,
"name": "maybe_cached_user_ratings_ratio",
"type_info": {
"type": "Float",
"flags": "",
"char_set": 63,
"max_size": 12
}
},
{
"ordinal": 25,
"name": "cached_user_ratings_last_updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 26,
"name": "version",
"type_info": {
"type": "Long",
"flags": "NOT_NULL",
"char_set": 63,
"max_size": 11
}
},
{
"ordinal": 27,
"name": "created_at",
"type_info": {
"type": "Timestamp",
@@ -284,7 +224,7 @@
}
},
{
"ordinal": 28,
"ordinal": 22,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
@@ -294,7 +234,7 @@
}
},
{
"ordinal": 29,
"ordinal": 23,
"name": "user_deleted_at",
"type_info": {
"type": "Timestamp",
@@ -304,7 +244,7 @@
}
},
{
"ordinal": 30,
"ordinal": 24,
"name": "mod_deleted_at",
"type_info": {
"type": "Timestamp",
@@ -315,18 +255,19 @@
}
],
"parameters": {
"Right": 1
"Right": 2
},
"nullable": [
false,
false,
false,
false,
false,
false,
true,
true,
true,
true,
false,
false,
false,
false,
false,
false,
false,
@@ -334,22 +275,15 @@
true,
true,
true,
false,
false,
false,
true,
true,
false,
false,
false,
true,
false,
false,
true,
false,
false,
true,
true
]
},
"hash": "ec733ae6705dc03fb785e2299c35fcfef23422142735319c8cd091ca8179f97d"
"hash": "6040227c139f6e2972734515b0a904d2a7b04bbf1a419677fc19287a0757ae21"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\nINSERT INTO model_weights\nSET\n token = ?,\n weights_type = ?,\n weights_category = ?,\n title = ?,\n\n maybe_cover_image_media_file_token = NULL,\n maybe_description_markdown = NULL,\n maybe_description_rendered_html = NULL,\n\n maybe_last_update_user_token = NULL,\n original_download_url = ?,\n original_filename = ?,\n file_size_bytes = ?,\n file_checksum_sha2 = ?,\n\n creator_user_token = ?,\n creator_ip_address = ?,\n creator_set_visibility = ?,\n\n public_bucket_hash = ?,\n maybe_public_bucket_prefix = ?,\n maybe_public_bucket_extension = ?,\n\n maybe_migration_old_model_token = ?\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 15
},
"nullable": []
},
"hash": "632305ab500cf892b98971e5b23af854112a66897766c890631dd5d0105cb065"
}
@@ -0,0 +1,102 @@
{
"db_name": "MySQL",
"query": "\n SELECT\n b2.token as `token: tokens::tokens::user_bookmarks::UserBookmarkToken`,\n\n b2.entity_type as `entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType`,\n b2.entity_token,\n\n b2.user_token as `user_token: tokens::tokens::users::UserToken`,\n\n es.bookmark_count as unused_bookmark_count,\n\n b2.created_at,\n b2.updated_at,\n b2.deleted_at\n\n FROM\n user_bookmarks AS b1\n\n JOIN user_bookmarks as b2\n ON b1.entity_type = b2.entity_type\n AND b1.entity_token = b2.entity_token\n\n LEFT OUTER JOIN entity_stats AS es\n ON b1.entity_type = es.entity_type\n AND b1.entity_token = es.entity_token\n\n WHERE\n b1.token = ?\n\n FOR UPDATE\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token: tokens::tokens::user_bookmarks::UserBookmarkToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 1,
"name": "entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 2,
"name": "entity_token",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 3,
"name": "user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 4,
"name": "unused_bookmark_count",
"type_info": {
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 5,
"name": "created_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 6,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP | ON_UPDATE_NOW",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 7,
"name": "deleted_at",
"type_info": {
"type": "Timestamp",
"flags": "MULTIPLE_KEY | BINARY",
"char_set": 63,
"max_size": 19
}
}
],
"parameters": {
"Right": 1
},
"nullable": [
false,
false,
false,
false,
true,
false,
false,
true
]
},
"hash": "706f0fd898ec367a7e2851e51c4d00dc63c89521238e55281737758ac87cfb01"
}
@@ -1,212 +0,0 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n f.token as `token: tokens::tokens::user_bookmarks::UserBookmarkToken`,\n f.entity_type as `entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType`,\n f.entity_token,\n f.user_token as `user_token: tokens::tokens::users::UserToken`,\n u.username,\n u.display_name as user_display_name,\n u.email_gravatar_hash as user_gravatar_hash,\n f.created_at,\n f.updated_at,\n f.deleted_at,\n\n media_files.media_type as `maybe_media_file_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n media_files.origin_product_category as `maybe_media_file_origin_category: enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory`,\n\n model_weights.title as maybe_descriptive_text_model_weight_title,\n tts_models.title as maybe_descriptive_text_tts_model_title,\n tts_results.raw_inference_text as maybe_descriptive_text_tts_result_inference_text,\n users.display_name as maybe_descriptive_text_user_display_name,\n voice_conversion_models.title as maybe_descriptive_text_voice_conversion_model_title,\n zs_voices.title as maybe_descriptive_text_zs_voice_title\n\nFROM\n user_bookmarks AS f\nJOIN users AS u\n ON f.user_token = u.token\n\nLEFT OUTER JOIN model_weights ON model_weights.token = f.entity_token\nLEFT OUTER JOIN media_files ON media_files.token = f.entity_token\nLEFT OUTER JOIN tts_models ON tts_models.token = f.entity_token\nLEFT OUTER JOIN tts_results ON tts_results.token = f.entity_token\nLEFT OUTER JOIN users ON users.token = f.entity_token\nLEFT OUTER JOIN voice_conversion_models ON voice_conversion_models.token = f.entity_token\nLEFT OUTER JOIN zs_voices ON zs_voices.token = f.entity_token\n\nWHERE\n u.username = ?\n AND f.deleted_at IS NULL\nORDER BY f.id DESC\nLIMIT 50\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token: tokens::tokens::user_bookmarks::UserBookmarkToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 1,
"name": "entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 2,
"name": "entity_token",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 3,
"name": "user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 4,
"name": "username",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 5,
"name": "user_display_name",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 6,
"name": "user_gravatar_hash",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 7,
"name": "created_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 8,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP | ON_UPDATE_NOW",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 9,
"name": "deleted_at",
"type_info": {
"type": "Timestamp",
"flags": "MULTIPLE_KEY | BINARY",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 10,
"name": "maybe_media_file_type: enums::by_table::media_files::media_file_type::MediaFileType",
"type_info": {
"type": "VarString",
"flags": "MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 11,
"name": "maybe_media_file_origin_category: enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory",
"type_info": {
"type": "VarString",
"flags": "MULTIPLE_KEY | BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 12,
"name": "maybe_descriptive_text_model_weight_title",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 13,
"name": "maybe_descriptive_text_tts_model_title",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 14,
"name": "maybe_descriptive_text_tts_result_inference_text",
"type_info": {
"type": "Blob",
"flags": "BLOB | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 262140
}
},
{
"ordinal": 15,
"name": "maybe_descriptive_text_user_display_name",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 16,
"name": "maybe_descriptive_text_voice_conversion_model_title",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 17,
"name": "maybe_descriptive_text_zs_voice_title",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
}
],
"parameters": {
"Right": 1
},
"nullable": [
false,
false,
false,
false,
false,
false,
false,
false,
false,
true,
true,
true,
true,
true,
true,
true,
true,
true
]
},
"hash": "707af35ee4ab4519f28e6d69982944666e6c7c0f24b5da79dde828ffdb2c8302"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\n INSERT INTO entity_stats SET\n entity_type = ?,\n entity_token = ?,\n ratings_positive_count = 1\n ON DUPLICATE KEY UPDATE\n ratings_positive_count = ratings_positive_count + 1\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "773047b78b08dd089d37a7f0d14cf5cce2ae580c4d6c673491f81144f9868ce3"
}
@@ -0,0 +1,102 @@
{
"db_name": "MySQL",
"query": "\n SELECT\n b.token as `token: tokens::tokens::user_bookmarks::UserBookmarkToken`,\n\n b.entity_type as `entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType`,\n b.entity_token,\n\n b.user_token as `user_token: tokens::tokens::users::UserToken`,\n\n es.bookmark_count as unused_bookmark_count,\n\n b.created_at,\n b.updated_at,\n b.deleted_at\n\n FROM\n user_bookmarks AS b\n\n LEFT OUTER JOIN entity_stats AS es\n ON b.entity_type = es.entity_type\n AND b.entity_token = es.entity_token\n WHERE\n b.entity_type = ?\n AND b.entity_token = ?\n FOR UPDATE\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token: tokens::tokens::user_bookmarks::UserBookmarkToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 1,
"name": "entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 2,
"name": "entity_token",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 3,
"name": "user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 4,
"name": "unused_bookmark_count",
"type_info": {
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 5,
"name": "created_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 6,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP | ON_UPDATE_NOW",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 7,
"name": "deleted_at",
"type_info": {
"type": "Timestamp",
"flags": "MULTIPLE_KEY | BINARY",
"char_set": 63,
"max_size": 19
}
}
],
"parameters": {
"Right": 2
},
"nullable": [
false,
false,
false,
false,
true,
false,
false,
true
]
},
"hash": "799a88505077c6c286906087ee79141dd4aaa1d68df764c9a43b315e561d7291"
}
@@ -1,12 +0,0 @@
{
"db_name": "MySQL",
"query": "\n UPDATE model_weights\n SET\n title = COALESCE(?, title),\n description_markdown = COALESCE(?, description_markdown),\n maybe_thumbnail_token = COALESCE(?, maybe_thumbnail_token),\n description_rendered_html = COALESCE(?, description_rendered_html),\n creator_set_visibility = COALESCE(?, creator_set_visibility),\n version = version + 1\n WHERE token = ?\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 6
},
"nullable": []
},
"hash": "81df77a84fee48398e8a07e053b0393a0e341caf652c18c7160dd0a59247a19a"
}
@@ -1,355 +0,0 @@
{
"db_name": "MySQL",
"query": "\n SELECT\n mw.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n mw.title,\n mw.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n mw.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n mw.maybe_thumbnail_token,\n mw.description_markdown,\n mw.description_rendered_html,\n users.token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash as creator_email_gravatar_hash,\n mw.creator_ip_address,\n mw.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n mw.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n mw.original_download_url,\n mw.original_filename,\n mw.file_size_bytes,\n mw.file_checksum_sha2,\n mw.public_bucket_hash,\n mw.maybe_public_bucket_prefix,\n mw.maybe_public_bucket_extension,\n mw.cached_user_ratings_negative_count,\n mw.cached_user_ratings_positive_count,\n mw.cached_user_ratings_total_count,\n mw.maybe_cached_user_ratings_ratio,\n mw.cached_user_ratings_last_updated_at,\n mw.version,\n mw.created_at,\n mw.updated_at,\n mw.user_deleted_at,\n mw.mod_deleted_at\n FROM model_weights as mw\n JOIN users\n ON users.token = mw.creator_user_token\n WHERE\n users.username = ?\n AND mw.user_deleted_at IS NULL\n AND mw.mod_deleted_at IS NULL\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token: tokens::tokens::model_weights::ModelWeightToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 1,
"name": "title",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 2,
"name": "weights_type: enums::by_table::model_weights::weights_types::WeightsType",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 3,
"name": "weights_category: enums::by_table::model_weights::weights_category::WeightsCategory",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 4,
"name": "maybe_thumbnail_token",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 5,
"name": "description_markdown",
"type_info": {
"type": "Blob",
"flags": "NOT_NULL | BLOB | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 262140
}
},
{
"ordinal": 6,
"name": "description_rendered_html",
"type_info": {
"type": "Blob",
"flags": "NOT_NULL | BLOB | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 262140
}
},
{
"ordinal": 7,
"name": "creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 8,
"name": "creator_username",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 9,
"name": "creator_display_name",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 10,
"name": "creator_email_gravatar_hash",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 11,
"name": "creator_ip_address",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 160
}
},
{
"ordinal": 12,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | ENUM",
"char_set": 224,
"max_size": 28
}
},
{
"ordinal": 13,
"name": "maybe_last_update_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 14,
"name": "original_download_url",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 2048
}
},
{
"ordinal": 15,
"name": "original_filename",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 16,
"name": "file_size_bytes",
"type_info": {
"type": "Long",
"flags": "NOT_NULL",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 17,
"name": "file_checksum_sha2",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 256
}
},
{
"ordinal": 18,
"name": "public_bucket_hash",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 19,
"name": "maybe_public_bucket_prefix",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 20,
"name": "maybe_public_bucket_extension",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 21,
"name": "cached_user_ratings_negative_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 22,
"name": "cached_user_ratings_positive_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 23,
"name": "cached_user_ratings_total_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 24,
"name": "maybe_cached_user_ratings_ratio",
"type_info": {
"type": "Float",
"flags": "",
"char_set": 63,
"max_size": 12
}
},
{
"ordinal": 25,
"name": "cached_user_ratings_last_updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 26,
"name": "version",
"type_info": {
"type": "Long",
"flags": "NOT_NULL",
"char_set": 63,
"max_size": 11
}
},
{
"ordinal": 27,
"name": "created_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 28,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP | ON_UPDATE_NOW",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 29,
"name": "user_deleted_at",
"type_info": {
"type": "Timestamp",
"flags": "BINARY",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 30,
"name": "mod_deleted_at",
"type_info": {
"type": "Timestamp",
"flags": "BINARY",
"char_set": 63,
"max_size": 19
}
}
],
"parameters": {
"Right": 1
},
"nullable": [
false,
false,
false,
false,
true,
false,
false,
false,
false,
false,
false,
false,
false,
true,
true,
true,
false,
false,
false,
true,
true,
false,
false,
false,
true,
false,
false,
false,
false,
true,
true
]
},
"hash": "854da1bad28fbcf5a8f82c26c52c25a7727957b52b727831ce62518b3c5fc9bd"
}
@@ -1,12 +0,0 @@
{
"db_name": "MySQL",
"query": "\nINSERT INTO model_weights\nSET\n token = ?,\n weights_type = ?,\n weights_category = ?,\n title = ?,\n\n maybe_thumbnail_token = NULL,\n maybe_avatar_media_file_token = NULL,\n maybe_cover_media_file_token = NULL,\n description_markdown = NULL,\n description_rendered_html = NULL,\n\n maybe_last_update_user_token = NULL,\n original_download_url = ?,\n original_filename = ?,\n file_size_bytes = ?,\n file_checksum_sha2 = ?,\n\n creator_user_token = ?,\n creator_ip_address = ?,\n creator_set_visibility = ?,\n\n public_bucket_hash = ?,\n maybe_public_bucket_prefix = ?,\n maybe_public_bucket_extension = ?,\n\n cached_user_ratings_total_count = 0,\n cached_user_ratings_positive_count = 0,\n cached_user_ratings_negative_count = 0,\n maybe_cached_user_ratings_ratio = 0.0,\n cached_user_ratings_last_updated_at = NOW(),\n\n maybe_migration_old_model_token = ?\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 15
},
"nullable": []
},
"hash": "8cb3ba5acb8dbef84408370810c98d4b99223761d4547ce7c8a9438ba92e8523"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\n INSERT INTO entity_stats SET\n entity_type = ?,\n entity_token = ?,\n ratings_positive_count = 0\n ON DUPLICATE KEY UPDATE\n ratings_positive_count = ABS(CAST(ratings_positive_count AS SIGNED) - 1)\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "9011676905b2a516fff4b43eb3692b973dede9b34a4876fda252510993720860"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\nUPDATE tts_models\nSET\n maybe_migration_new_model_weights_token = ?\nWHERE token = ?\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "aa7ec1c1e32f773212b264f34173f99db1e515e370c47065f932aaec56f89112"
}
@@ -1,12 +0,0 @@
{
"db_name": "MySQL",
"query": "\nINSERT INTO model_weights\nSET\n token = ?,\n weights_type = ?,\n weights_category = ?,\n title = ?,\n maybe_thumbnail_token = NULL,\n maybe_avatar_media_file_token = NULL,\n maybe_cover_media_file_token = NULL,\n description_markdown = ?,\n description_rendered_html = ?,\n creator_user_token = ?,\n creator_ip_address = ?,\n\n creator_set_visibility = ?,\n maybe_last_update_user_token = NULL,\n original_download_url = ?,\n original_filename = ?,\n file_size_bytes = ?,\n file_checksum_sha2 = ?,\n\n public_bucket_hash = ?,\n maybe_public_bucket_prefix = ?,\n maybe_public_bucket_extension = ?,\n cached_user_ratings_total_count = 0,\n cached_user_ratings_positive_count = 0,\n cached_user_ratings_negative_count = 0,\n maybe_cached_user_ratings_ratio = 0.0,\n cached_user_ratings_last_updated_at = NOW(),\n\n maybe_migration_old_model_token = ?,\n version = ?,\n created_at = ?,\n updated_at = ?,\n user_deleted_at = ?,\n mod_deleted_at = ?\n\nON DUPLICATE KEY UPDATE\n weights_type = ?,\n weights_category = ?,\n title = ?,\n maybe_thumbnail_token = NULL,\n maybe_avatar_media_file_token = NULL,\n maybe_cover_media_file_token = NULL,\n description_markdown = ?,\n description_rendered_html = ?,\n creator_user_token = ?,\n creator_ip_address = ?,\n creator_set_visibility = ?,\n maybe_last_update_user_token = NULL,\n original_download_url = ?,\n original_filename = ?,\n file_size_bytes = ?,\n file_checksum_sha2 = ?,\n public_bucket_hash = ?,\n maybe_public_bucket_prefix = ?,\n maybe_public_bucket_extension = ?,\n cached_user_ratings_total_count = 0,\n cached_user_ratings_positive_count = 0,\n cached_user_ratings_negative_count = 0,\n maybe_cached_user_ratings_ratio = 0.0,\n cached_user_ratings_last_updated_at = NOW(),\n maybe_migration_old_model_token = ?,\n version = ?,\n created_at = ?,\n updated_at = ?,\n user_deleted_at = ?,\n mod_deleted_at = ?\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 43
},
"nullable": []
},
"hash": "aae28dc5fbeff858e4c9dd8b079752ce7892d76b56d2eff95db39c6b6d9f7f11"
}
@@ -0,0 +1,25 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n COUNT(*) as total_count\nFROM\n user_bookmarks\nWHERE\n entity_type = ?\n AND entity_token = ?\n AND deleted_at IS NULL\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "total_count",
"type_info": {
"type": "LongLong",
"flags": "NOT_NULL | BINARY",
"char_set": 63,
"max_size": 21
}
}
],
"parameters": {
"Right": 2
},
"nullable": [
false
]
},
"hash": "abcda1fc0b5a28166f3e15f2b3df96c5b6556d0ea3009d3f2bc9995bae95147e"
}
@@ -0,0 +1,300 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n m.token as `token: tokens::tokens::media_files::MediaFileToken`,\n\n m.media_type as `media_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n\n users.token as `maybe_creator_user_token: tokens::tokens::users::UserToken`,\n users.username as maybe_creator_username,\n users.display_name as maybe_creator_display_name,\n users.email_gravatar_hash as maybe_creator_gravatar_hash,\n\n m.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n model_weights.token as `maybe_model_weights_token: tokens::tokens::model_weights::ModelWeightToken`,\n model_weights.title as maybe_model_weights_title,\n model_weights.weights_type as `maybe_model_weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n model_weights.weights_category as `maybe_model_weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n\n cover_image.public_bucket_directory_hash as maybe_model_cover_image_public_bucket_hash,\n cover_image.maybe_public_bucket_prefix as maybe_model_cover_image_public_bucket_prefix,\n cover_image.maybe_public_bucket_extension as maybe_model_cover_image_public_bucket_extension,\n\n model_weight_creator.token as `maybe_model_weight_creator_user_token: tokens::tokens::users::UserToken`,\n model_weight_creator.username as maybe_model_weight_creator_username,\n model_weight_creator.display_name as maybe_model_weight_creator_display_name,\n model_weight_creator.email_gravatar_hash as maybe_model_weight_creator_gravatar_hash,\n\n m.public_bucket_directory_hash,\n m.maybe_public_bucket_prefix,\n m.maybe_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n\n m.created_at,\n m.updated_at\n\nFROM media_files AS m\nLEFT OUTER JOIN users\n ON m.maybe_creator_user_token = users.token\nLEFT OUTER JOIN model_weights\n ON m.maybe_origin_model_token = model_weights.token\nLEFT OUTER JOIN media_files as cover_image\n ON cover_image.token = model_weights.maybe_cover_image_media_file_token\nLEFT OUTER JOIN users as model_weight_creator\n ON model_weight_creator.token = model_weights.creator_user_token\nLEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"media_file\"\n AND entity_stats.entity_token = m.token\nWHERE\n m.token = ?\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token: tokens::tokens::media_files::MediaFileToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 1,
"name": "media_type: enums::by_table::media_files::media_file_type::MediaFileType",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 2,
"name": "maybe_creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 3,
"name": "maybe_creator_username",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 4,
"name": "maybe_creator_display_name",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 5,
"name": "maybe_creator_gravatar_hash",
"type_info": {
"type": "String",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 6,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | ENUM",
"char_set": 224,
"max_size": 28
}
},
{
"ordinal": 7,
"name": "maybe_model_weights_token: tokens::tokens::model_weights::ModelWeightToken",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 8,
"name": "maybe_model_weights_title",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 1020
}
},
{
"ordinal": 9,
"name": "maybe_model_weights_type: enums::by_table::model_weights::weights_types::WeightsType",
"type_info": {
"type": "VarString",
"flags": "MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 10,
"name": "maybe_model_weights_category: enums::by_table::model_weights::weights_category::WeightsCategory",
"type_info": {
"type": "VarString",
"flags": "MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 11,
"name": "maybe_model_cover_image_public_bucket_hash",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 12,
"name": "maybe_model_cover_image_public_bucket_prefix",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 13,
"name": "maybe_model_cover_image_public_bucket_extension",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 14,
"name": "maybe_model_weight_creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 15,
"name": "maybe_model_weight_creator_username",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 16,
"name": "maybe_model_weight_creator_display_name",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 17,
"name": "maybe_model_weight_creator_gravatar_hash",
"type_info": {
"type": "String",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 18,
"name": "public_bucket_directory_hash",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 19,
"name": "maybe_public_bucket_prefix",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 20,
"name": "maybe_public_bucket_extension",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 21,
"name": "maybe_ratings_positive_count",
"type_info": {
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 22,
"name": "maybe_ratings_negative_count",
"type_info": {
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 23,
"name": "maybe_bookmark_count",
"type_info": {
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 24,
"name": "created_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 25,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP | ON_UPDATE_NOW",
"char_set": 63,
"max_size": 19
}
}
],
"parameters": {
"Right": 1
},
"nullable": [
false,
false,
true,
true,
true,
true,
false,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
false,
true,
true,
true,
true,
true,
false,
false
]
},
"hash": "c2de3b6de37dbbb5b6afd91af08aae2739cda97ef8ebb8f9b4ee967969ce43be"
}
@@ -1,12 +0,0 @@
{
"db_name": "MySQL",
"query": "\n INSERT INTO model_weights\n SET\n token = ?,\n weights_type = ?,\n weights_category = ?,\n title = ?,\n maybe_thumbnail_token = ?,\n description_markdown = ?,\n description_rendered_html = ?,\n creator_user_token = ?,\n creator_ip_address = ?,\n creator_set_visibility = ?,\n maybe_last_update_user_token = ?,\n original_download_url = ?,\n original_filename = ?,\n file_size_bytes = ?,\n file_checksum_sha2 = ?,\n public_bucket_hash = ?,\n maybe_public_bucket_prefix = ?,\n maybe_public_bucket_extension = ?,\n cached_user_ratings_total_count = ?,\n cached_user_ratings_positive_count = ?,\n cached_user_ratings_negative_count = ?,\n maybe_cached_user_ratings_ratio = ?,\n version = ?\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 23
},
"nullable": []
},
"hash": "cb07f1522d0d619e2f364af78250080c99e7930ec095c5600abb80a9d8c5154d"
}
@@ -1,6 +1,6 @@
{
"db_name": "MySQL",
"query": "\n UPDATE model_weights\n SET\n maybe_avatar_media_file_token = ?\n WHERE token = ?\n LIMIT 1\n ",
"query": "\n UPDATE model_weights\n SET\n maybe_cover_image_media_file_token = ?\n WHERE token = ?\n LIMIT 1\n ",
"describe": {
"columns": [],
"parameters": {
@@ -8,5 +8,5 @@
},
"nullable": []
},
"hash": "bda002b24b98328f0fb0440cfc82a47faf01e5d16d1030e15a7e2da161dd0d80"
"hash": "d7b28a5b4f0220b02eacb01df030c4d971fd191cf3cb5f0211ce29604d36bca3"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\nINSERT INTO model_weights\nSET\n token = ?,\n weights_type = ?,\n weights_category = ?,\n title = ?,\n maybe_cover_image_media_file_token = NULL,\n maybe_description_markdown = ?,\n maybe_description_rendered_html = ?,\n creator_user_token = ?,\n creator_ip_address = ?,\n\n creator_set_visibility = ?,\n maybe_last_update_user_token = NULL,\n original_download_url = ?,\n original_filename = ?,\n file_size_bytes = ?,\n file_checksum_sha2 = ?,\n\n public_bucket_hash = ?,\n maybe_public_bucket_prefix = ?,\n maybe_public_bucket_extension = ?,\n\n maybe_migration_old_model_token = ?,\n version = ?,\n created_at = ?,\n updated_at = ?,\n user_deleted_at = ?,\n mod_deleted_at = ?\n\nON DUPLICATE KEY UPDATE\n weights_type = ?,\n weights_category = ?,\n title = ?,\n maybe_cover_image_media_file_token = NULL,\n maybe_description_markdown = ?,\n maybe_description_rendered_html = ?,\n creator_user_token = ?,\n creator_ip_address = ?,\n creator_set_visibility = ?,\n maybe_last_update_user_token = NULL,\n original_download_url = ?,\n original_filename = ?,\n file_size_bytes = ?,\n file_checksum_sha2 = ?,\n public_bucket_hash = ?,\n maybe_public_bucket_prefix = ?,\n maybe_public_bucket_extension = ?,\n maybe_migration_old_model_token = ?,\n version = ?,\n created_at = ?,\n updated_at = ?,\n user_deleted_at = ?,\n mod_deleted_at = ?\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 43
},
"nullable": []
},
"hash": "d8b255de4b16f95454c34e793c7a52726de90c2af490b17c415d7e92c00d9123"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\n INSERT INTO model_weights\n SET\n token = ?,\n weights_type = ?,\n weights_category = ?,\n title = ?,\n maybe_description_markdown = ?,\n maybe_description_rendered_html = ?,\n creator_user_token = ?,\n creator_ip_address = ?,\n creator_set_visibility = ?,\n maybe_last_update_user_token = ?,\n original_download_url = ?,\n original_filename = ?,\n file_size_bytes = ?,\n file_checksum_sha2 = ?,\n public_bucket_hash = ?,\n maybe_public_bucket_prefix = ?,\n maybe_public_bucket_extension = ?,\n version = ?\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 18
},
"nullable": []
},
"hash": "db59a239bac6f5ceaad4396dfe6c2c933a7189dbf8da5f555b94148db1b0667f"
}
@@ -1,146 +0,0 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n m.token as `token: tokens::tokens::media_files::MediaFileToken`,\n\n m.media_type as `media_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n\n users.token as `maybe_creator_user_token: tokens::tokens::users::UserToken`,\n users.username as maybe_creator_username,\n users.display_name as maybe_creator_display_name,\n users.email_gravatar_hash as maybe_creator_gravatar_hash,\n\n m.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n m.public_bucket_directory_hash,\n m.maybe_public_bucket_prefix,\n m.maybe_public_bucket_extension,\n\n m.created_at,\n m.updated_at\n\nFROM media_files AS m\nLEFT OUTER JOIN users\n ON m.maybe_creator_user_token = users.token\nWHERE\n m.token = ?\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token: tokens::tokens::media_files::MediaFileToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 1,
"name": "media_type: enums::by_table::media_files::media_file_type::MediaFileType",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 2,
"name": "maybe_creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 3,
"name": "maybe_creator_username",
"type_info": {
"type": "VarString",
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 4,
"name": "maybe_creator_display_name",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 5,
"name": "maybe_creator_gravatar_hash",
"type_info": {
"type": "String",
"flags": "BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 6,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | ENUM",
"char_set": 224,
"max_size": 28
}
},
{
"ordinal": 7,
"name": "public_bucket_directory_hash",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 8,
"name": "maybe_public_bucket_prefix",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 9,
"name": "maybe_public_bucket_extension",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 10,
"name": "created_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 11,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP | ON_UPDATE_NOW",
"char_set": 63,
"max_size": 19
}
}
],
"parameters": {
"Right": 1
},
"nullable": [
false,
false,
true,
true,
true,
true,
false,
false,
true,
true,
false,
false
]
},
"hash": "dcc8de321d68f8d54f5978b17cec7247013142fa26ac360016e849e88cf844ad"
}
@@ -1,6 +1,6 @@
{
"db_name": "MySQL",
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_thumbnail_token,\n wt.description_markdown,\n wt.description_rendered_html,\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash AS creator_gravatar_hash,\n\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n avatar.public_bucket_directory_hash as maybe_avatar_public_bucket_hash,\n avatar.maybe_public_bucket_prefix as maybe_avatar_public_bucket_prefix,\n avatar.maybe_public_bucket_extension as maybe_avatar_public_bucket_extension,\n\n wt.cached_user_ratings_negative_count,\n wt.cached_user_ratings_positive_count,\n wt.cached_user_ratings_total_count,\n wt.maybe_cached_user_ratings_ratio,\n wt.cached_user_ratings_last_updated_at,\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n FROM model_weights as wt\n JOIN users\n ON users.token = wt.creator_user_token\n LEFT OUTER JOIN media_files as avatar\n ON avatar.token = wt.maybe_avatar_media_file_token\n WHERE\n wt.token = ?\n AND wt.user_deleted_at IS NULL\n AND wt.mod_deleted_at IS NULL\n ",
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_description_markdown,\n wt.maybe_description_rendered_html,\n\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash AS creator_gravatar_hash,\n\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n cover_image.public_bucket_directory_hash as maybe_cover_image_public_bucket_hash,\n cover_image.maybe_public_bucket_prefix as maybe_cover_image_public_bucket_prefix,\n cover_image.maybe_public_bucket_extension as maybe_cover_image_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n FROM model_weights as wt\n JOIN users\n ON users.token = wt.creator_user_token\n LEFT OUTER JOIN media_files as cover_image\n ON cover_image.token = wt.maybe_cover_image_media_file_token\n LEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"model_weight\"\n AND entity_stats.entity_token = wt.token\n WHERE\n wt.token = ?\n ",
"describe": {
"columns": [
{
@@ -45,56 +45,26 @@
},
{
"ordinal": 4,
"name": "maybe_thumbnail_token",
"name": "maybe_description_markdown",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"type": "Blob",
"flags": "BLOB | BINARY",
"char_set": 224,
"max_size": 128
"max_size": 262140
}
},
{
"ordinal": 5,
"name": "description_markdown",
"name": "maybe_description_rendered_html",
"type_info": {
"type": "Blob",
"flags": "NOT_NULL | BLOB | BINARY | NO_DEFAULT_VALUE",
"flags": "BLOB | BINARY",
"char_set": 224,
"max_size": 262140
}
},
{
"ordinal": 6,
"name": "description_rendered_html",
"type_info": {
"type": "Blob",
"flags": "NOT_NULL | BLOB | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 262140
}
},
{
"ordinal": 7,
"name": "creator_ip_address",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 160
}
},
{
"ordinal": 8,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | ENUM",
"char_set": 224,
"max_size": 28
}
},
{
"ordinal": 9,
"name": "creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
@@ -104,7 +74,7 @@
}
},
{
"ordinal": 10,
"ordinal": 7,
"name": "creator_username",
"type_info": {
"type": "VarString",
@@ -114,7 +84,7 @@
}
},
{
"ordinal": 11,
"ordinal": 8,
"name": "creator_display_name",
"type_info": {
"type": "VarString",
@@ -124,7 +94,7 @@
}
},
{
"ordinal": 12,
"ordinal": 9,
"name": "creator_gravatar_hash",
"type_info": {
"type": "String",
@@ -134,7 +104,27 @@
}
},
{
"ordinal": 13,
"ordinal": 10,
"name": "creator_ip_address",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 160
}
},
{
"ordinal": 11,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | ENUM",
"char_set": 224,
"max_size": 28
}
},
{
"ordinal": 12,
"name": "maybe_last_update_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
@@ -144,7 +134,7 @@
}
},
{
"ordinal": 14,
"ordinal": 13,
"name": "original_download_url",
"type_info": {
"type": "VarString",
@@ -154,7 +144,7 @@
}
},
{
"ordinal": 15,
"ordinal": 14,
"name": "original_filename",
"type_info": {
"type": "VarString",
@@ -164,7 +154,7 @@
}
},
{
"ordinal": 16,
"ordinal": 15,
"name": "file_size_bytes",
"type_info": {
"type": "Long",
@@ -174,7 +164,7 @@
}
},
{
"ordinal": 17,
"ordinal": 16,
"name": "file_checksum_sha2",
"type_info": {
"type": "String",
@@ -184,7 +174,7 @@
}
},
{
"ordinal": 18,
"ordinal": 17,
"name": "public_bucket_hash",
"type_info": {
"type": "VarString",
@@ -194,7 +184,7 @@
}
},
{
"ordinal": 19,
"ordinal": 18,
"name": "maybe_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -204,7 +194,7 @@
}
},
{
"ordinal": 20,
"ordinal": 19,
"name": "maybe_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -214,8 +204,8 @@
}
},
{
"ordinal": 21,
"name": "maybe_avatar_public_bucket_hash",
"ordinal": 20,
"name": "maybe_cover_image_public_bucket_hash",
"type_info": {
"type": "VarString",
"flags": "BINARY | NO_DEFAULT_VALUE",
@@ -223,9 +213,19 @@
"max_size": 128
}
},
{
"ordinal": 21,
"name": "maybe_cover_image_public_bucket_prefix",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
}
},
{
"ordinal": 22,
"name": "maybe_avatar_public_bucket_prefix",
"name": "maybe_cover_image_public_bucket_extension",
"type_info": {
"type": "VarString",
"flags": "BINARY",
@@ -235,66 +235,36 @@
},
{
"ordinal": 23,
"name": "maybe_avatar_public_bucket_extension",
"name": "maybe_ratings_positive_count",
"type_info": {
"type": "VarString",
"flags": "BINARY",
"char_set": 224,
"max_size": 64
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 24,
"name": "cached_user_ratings_negative_count",
"name": "maybe_ratings_negative_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 25,
"name": "cached_user_ratings_positive_count",
"name": "maybe_bookmark_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 26,
"name": "cached_user_ratings_total_count",
"type_info": {
"type": "Long",
"flags": "NOT_NULL | UNSIGNED",
"char_set": 63,
"max_size": 10
}
},
{
"ordinal": 27,
"name": "maybe_cached_user_ratings_ratio",
"type_info": {
"type": "Float",
"flags": "",
"char_set": 63,
"max_size": 12
}
},
{
"ordinal": 28,
"name": "cached_user_ratings_last_updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 29,
"name": "version",
"type_info": {
"type": "Long",
@@ -304,7 +274,7 @@
}
},
{
"ordinal": 30,
"ordinal": 27,
"name": "created_at",
"type_info": {
"type": "Timestamp",
@@ -314,7 +284,7 @@
}
},
{
"ordinal": 31,
"ordinal": 28,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
@@ -324,7 +294,7 @@
}
},
{
"ordinal": 32,
"ordinal": 29,
"name": "user_deleted_at",
"type_info": {
"type": "Timestamp",
@@ -334,7 +304,7 @@
}
},
{
"ordinal": 33,
"ordinal": 30,
"name": "mod_deleted_at",
"type_info": {
"type": "Timestamp",
@@ -353,8 +323,7 @@
false,
false,
true,
false,
false,
true,
false,
false,
false,
@@ -372,11 +341,9 @@
true,
true,
true,
false,
false,
false,
true,
false,
true,
true,
false,
false,
false,
@@ -384,5 +351,5 @@
true
]
},
"hash": "93084dc42ae4ada186dc90bdd470122342586f4f19a3ac961286c1c54a5c32b2"
"hash": "e32645b06d20a0037c3ca3d514b56af2dba8396f11a4c2a93ee4fab9b4579fc3"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\n INSERT INTO entity_stats SET\n entity_type = ?,\n entity_token = ?,\n bookmark_count = 0\n ON DUPLICATE KEY UPDATE\n bookmark_count = ABS(CAST(bookmark_count AS SIGNED) - 1)\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "e3bbd9cb8a0b8fdb74fcb809ea63709740a04ab936e47f5641af0eaf3e0fd339"
}
@@ -0,0 +1,12 @@
{
"db_name": "MySQL",
"query": "\n INSERT INTO entity_stats SET\n entity_type = ?,\n entity_token = ?,\n ratings_negative_count = 0\n ON DUPLICATE KEY UPDATE\n ratings_negative_count = ABS(CAST(ratings_negative_count AS SIGNED) - 1)\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "e67894beb8e747e0f8c301e806d9fa62e685f23e2c581a07235568dd1a63f519"
}
@@ -0,0 +1,25 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n COUNT(*) as positive_count\nFROM\n user_ratings\nWHERE\n entity_type = ?\n AND entity_token = ?\n AND rating_value = 'positive'\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "positive_count",
"type_info": {
"type": "LongLong",
"flags": "NOT_NULL | BINARY",
"char_set": 63,
"max_size": 21
}
}
],
"parameters": {
"Right": 2
},
"nullable": [
false
]
},
"hash": "f9f52bf39daf43a8e6e9617282bf9bc83a62d53b69ab36a8429576c03d5c18d7"
}
@@ -0,0 +1,58 @@
{
"db_name": "MySQL",
"query": "\nSELECT\n r.rating_value as `rating_value: enums::by_table::user_ratings::rating_value::UserRatingValue`,\n r.created_at,\n r.updated_at,\n\n es.ratings_positive_count as unused_ratings_positive_count\n\nFROM user_ratings AS r\n\nLEFT OUTER JOIN entity_stats AS es\n ON r.entity_type = es.entity_type\n AND r.entity_token = es.entity_token\n\nWHERE r.user_token = ?\n AND r.entity_type = ?\n AND r.entity_token = ?\n\nLIMIT 1\n\nFOR UPDATE\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "rating_value: enums::by_table::user_ratings::rating_value::UserRatingValue",
"type_info": {
"type": "String",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | ENUM",
"char_set": 224,
"max_size": 32
}
},
{
"ordinal": 1,
"name": "created_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 2,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
"flags": "NOT_NULL | BINARY | TIMESTAMP | ON_UPDATE_NOW",
"char_set": 63,
"max_size": 19
}
},
{
"ordinal": 3,
"name": "unused_ratings_positive_count",
"type_info": {
"type": "Long",
"flags": "UNSIGNED",
"char_set": 63,
"max_size": 10
}
}
],
"parameters": {
"Right": 3
},
"nullable": [
false,
false,
false,
true
]
},
"hash": "fa724ca3644d7cba26e503c1a2c900bea00e10250c703019363fe9cf855a5a69"
}
Generated
+127 -3
View File
@@ -301,6 +301,55 @@ dependencies = [
"syn 2.0.39",
]
[[package]]
name = "actix-web-lab"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6ddd78b365b70614e27f49a128ab8edba32bbc8f9b2abb1fbe07f15dd48cfab"
dependencies = [
"actix-http",
"actix-router",
"actix-service",
"actix-utils",
"actix-web",
"actix-web-lab-derive",
"ahash 0.8.6",
"arc-swap",
"async-trait",
"bytes 1.5.0",
"bytestring",
"csv",
"derive_more",
"futures-core",
"futures-util",
"http",
"impl-more",
"itertools 0.11.0",
"local-channel",
"mediatype",
"mime",
"once_cell",
"pin-project-lite",
"regex",
"serde",
"serde_html_form",
"serde_json",
"tokio",
"tokio-stream",
"tracing",
]
[[package]]
name = "actix-web-lab-derive"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aa0b287c8de4a76b691f29dbb5451e8dd5b79d777eaf87350c9b0cbfdb5e968"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.39",
]
[[package]]
name = "actix_derive"
version = "0.6.1"
@@ -543,6 +592,12 @@ version = "1.0.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
[[package]]
name = "arc-swap"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6"
[[package]]
name = "archives"
version = "0.0.1"
@@ -1204,6 +1259,24 @@ dependencies = [
"my-workspace-hack",
]
[[package]]
name = "composite_identifiers"
version = "0.0.1"
dependencies = [
"enums",
"my-workspace-hack",
"serde",
"serde_derive",
"serde_json",
"sqlx",
"sqlx-core",
"sqlx-mysql",
"strum",
"tokens",
"toml 0.5.11",
"utoipa",
]
[[package]]
name = "concurrency"
version = "0.0.1"
@@ -1464,6 +1537,27 @@ dependencies = [
"syn 2.0.39",
]
[[package]]
name = "csv"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe"
dependencies = [
"csv-core",
"itoa 1.0.9",
"ryu",
"serde",
]
[[package]]
name = "csv-core"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70"
dependencies = [
"memchr",
]
[[package]]
name = "darling"
version = "0.13.4"
@@ -1914,6 +2008,7 @@ dependencies = [
"serde_derive",
"serde_json",
"sqlx",
"storyteller_root",
"subprocess",
"subprocess_common",
"tempdir",
@@ -2921,6 +3016,12 @@ dependencies = [
"testing",
]
[[package]]
name = "impl-more"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "206ca75c9c03ba3d4ace2460e57b189f39f43de612c2f85836e65c929701bb2d"
[[package]]
name = "indexmap"
version = "2.1.0"
@@ -2949,9 +3050,9 @@ dependencies = [
[[package]]
name = "infer"
version = "0.11.0"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a6c16b11a665b26aeeb9b1d7f954cdeb034be38dd00adab4f2ae921a8fee804"
checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199"
dependencies = [
"cfb 0.7.3",
]
@@ -2969,6 +3070,7 @@ dependencies = [
"chrono",
"cloud_storage",
"collections",
"composite_identifiers",
"concurrency",
"config",
"dotenv",
@@ -3459,6 +3561,12 @@ dependencies = [
"symphonia",
]
[[package]]
name = "mediatype"
version = "0.19.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf0bc9784973713e4a90d515a4302991ca125a7c4516951cb607f2298cb757e5"
[[package]]
name = "memchr"
version = "2.6.4"
@@ -3564,7 +3672,7 @@ dependencies = [
name = "mimetypes"
version = "0.0.1"
dependencies = [
"infer 0.11.0",
"infer 0.15.0",
"my-workspace-hack",
]
@@ -3768,6 +3876,7 @@ dependencies = [
"anyhow",
"buckets",
"chrono",
"composite_identifiers",
"config",
"container_common",
"dotenv",
@@ -5272,6 +5381,19 @@ dependencies = [
"syn 2.0.39",
]
[[package]]
name = "serde_html_form"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "224e6a14f315852940f3ec103125aa6482f0e224732ed91ed3330ed633077c34"
dependencies = [
"form_urlencoded",
"indexmap",
"itoa 1.0.9",
"ryu",
"serde",
]
[[package]]
name = "serde_json"
version = "1.0.108"
@@ -5892,6 +6014,7 @@ dependencies = [
"actix-service",
"actix-utils",
"actix-web",
"actix-web-lab",
"actix_helpers",
"anyhow",
"async-stripe",
@@ -5903,6 +6026,7 @@ dependencies = [
"buckets",
"chrono",
"cloud_storage",
"composite_identifiers",
"config",
"container_common",
"cookies",
+1
View File
@@ -5,6 +5,7 @@ members = [
# Types: common strongly-typed tokens, ids, payloads, etc.
# Also common cloud buckets and other "strongly typed" configs.
"crates/_types/buckets",
"crates/_types/composite_identifiers",
"crates/_types/enums",
"crates/_types/reusable_types", # TODO(bt, 2022-12-21): Deprecate
"crates/_types/tokens",
+4
View File
@@ -41,6 +41,10 @@ deny = [
# Rust
"unused_imports", # These are easy to automatically cull
"unused_parens", # Unused parens are ugly
"unused_variables", # Don't leave cruft
#"unused_mut", # Be strict about mutability (TODO)
# Possible:
# "clippy::ptr_arg",
@@ -0,0 +1,40 @@
{
"settings" : {
"index.number_of_shards" : 3,
"index.number_of_replicas" : 2
},
"mappings" : {
"properties" : {
"token" : { "type" : "keyword" },
"creator_set_visibility" : { "type" : "keyword" },
"weights_type" : { "type" : "keyword" },
"weights_category" : { "type" : "keyword" },
"title" : { "type" : "search_as_you_type" },
"maybe_cover_image_media_file_token" : { "type" : "keyword" },
"maybe_cover_image_public_bucket_hash" : { "type" : "keyword" },
"maybe_cover_image_public_bucket_prefix" : { "type" : "keyword" },
"maybe_cover_image_public_bucket_extension" : { "type" : "keyword" },
"creator_user_token" : { "type" : "keyword" },
"creator_username" : { "type" : "keyword" },
"creator_display_name" : { "type" : "text" },
"creator_gravatar_hash" : { "type" : "text" },
"ratings_positive_count" : { "type" : "unsigned_long" },
"ratings_negative_count" : { "type" : "unsigned_long" },
"bookmark_count" : { "type" : "unsigned_long" },
"maybe_ietf_language_tag" : { "type" : "keyword" },
"maybe_ietf_primary_language_subtag" : { "type" : "keyword" },
"created_at" : { "type" : "date" },
"updated_at" : { "type" : "date" },
"user_deleted_at" : { "type" : "date" },
"mod_deleted_at" : { "type" : "date" }
}
}
}
+4 -4
View File
@@ -8,14 +8,14 @@ select
id,
token,
download_type,
title,
download_url,
SUBSTRING(title, 1, 35) as title,
SUBSTRING(download_url, 1, 100) as title,
status,
attempt_count
from generic_download_jobs
where status IN ('started', 'attempt_failed', 'complete_failure', 'dead')
and download_type NOT IN ('vits', 'hifigan')
and created_at > NOW() - INTERVAL 15 DAY;
and created_at > NOW() - INTERVAL 30 DAY;
-- 2) Then restart them
@@ -32,7 +32,7 @@ where token IN (
from generic_download_jobs
where status IN ('started', 'attempt_failed', 'complete_failure', 'dead')
and download_type NOT IN ('vits', 'hifigan')
and created_at > NOW() - INTERVAL 15 DAY
and created_at > NOW() - INTERVAL 120 DAY
) as x
);
@@ -0,0 +1,24 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Summary stats on downloads
select
distinct download_type,
count(*) as created
from generic_download_jobs
where created_at > (CURDATE() - INTERVAL 60 DAY)
group by download_type;
-- Find recent failed RVC downloads
select
token,
title,
download_url,
status,
assigned_worker
from generic_download_jobs
where download_type = 'rvc_v2'
and status IN ('started', 'attempt_failed', 'dead')
and created_at > (CURDATE() - INTERVAL 12 HOUR)
order by updated_at desc;
+14
View File
@@ -2,6 +2,20 @@
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Find jobs that are broken for a given user
select id, last_assigned_worker, internal_debugging_failure_reason,created_at
from tts_inference_jobs
where maybe_creator_user_token IN (
select token
from users
where username IN ('knifecat ', 'rewritten_code', 'johnloberger')
)
and attempt_count > 1
and status IN ('complete_failure', 'dead', 'attempt_failed')
and created_at > ( CURDATE() - INTERVAL 5 DAY );
-- Total pending jobs
select count(*)
from tts_inference_jobs
@@ -0,0 +1,6 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE model_weights
RENAME COLUMN maybe_cover_image_media_file_token TO maybe_cover_media_file_token;
@@ -0,0 +1,6 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE model_weights
RENAME COLUMN maybe_cover_media_file_token TO maybe_cover_image_media_file_token;
@@ -0,0 +1,13 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE model_weights
ADD COLUMN maybe_thumbnail_token VARCHAR(32) DEFAULT NULL
AFTER title;
ALTER TABLE model_weights
ADD COLUMN maybe_avatar_media_file_token VARCHAR(32) DEFAULT NULL
AFTER maybe_thumbnail_token;
CREATE INDEX fk_maybe_avatar_media_file_token ON model_weights (maybe_avatar_media_file_token);
@@ -0,0 +1,7 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Drop column
ALTER TABLE model_weights DROP COLUMN maybe_thumbnail_token;
ALTER TABLE model_weights DROP COLUMN maybe_avatar_media_file_token;
@@ -0,0 +1,9 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE model_weights
CHANGE maybe_description_markdown description_markdown TEXT NOT NULL;
ALTER TABLE model_weights
CHANGE maybe_description_rendered_html description_rendered_html TEXT NOT NULL;
@@ -0,0 +1,9 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE model_weights
CHANGE description_markdown maybe_description_markdown TEXT DEFAULT NULL;
ALTER TABLE model_weights
CHANGE description_rendered_html maybe_description_rendered_html TEXT DEFAULT NULL;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
drop table entity_stats;
@@ -0,0 +1,56 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Statistics about any entity. Typically model weights and media files.
CREATE TABLE entity_stats (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- ========== ENTITY LINKAGE ==========
-- The type of record this is attached to
-- Currently supported values:
-- * 'model_weight'
-- * 'media_file'
-- * 'comment'
entity_type VARCHAR(32) NOT NULL,
-- The token for the record.
entity_token VARCHAR(32) NOT NULL,
-- ========== MODEL DESCRIPTION ==========
-- Total positive ratings
-- Total overall ratings = positive + negative
ratings_positive_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- Total negative ratings
-- Total overall ratings = positive + negative
ratings_negative_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- Total number of user bookmarks
bookmark_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- Total number of views
-- view_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- Total number of views
-- play_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- ========== TIMESTAMPS ==========
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- When the cached ratings were last calculated and updated.
-- maybe_last_backfilled_at TIMESTAMP DEFAULT NULL,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (entity_type, entity_token),
KEY index_entity_type (entity_type),
KEY index_entity_token (entity_token)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
@@ -0,0 +1,23 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE model_weights ADD COLUMN
cached_user_ratings_total_count INT(10) UNSIGNED NOT NULL DEFAULT 0
AFTER maybe_public_bucket_extension;
ALTER TABLE model_weights ADD COLUMN
cached_user_ratings_positive_count INT(10) UNSIGNED NOT NULL DEFAULT 0
AFTER cached_user_ratings_total_count;
ALTER TABLE model_weights ADD COLUMN
cached_user_ratings_negative_count INT(10) UNSIGNED NOT NULL DEFAULT 0
AFTER cached_user_ratings_positive_count;
ALTER TABLE model_weights ADD COLUMN
maybe_cached_user_ratings_ratio FLOAT
AFTER cached_user_ratings_negative_count;
ALTER TABLE model_weights ADD COLUMN
cached_user_ratings_last_updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
AFTER maybe_cached_user_ratings_ratio;
@@ -0,0 +1,13 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE model_weights DROP COLUMN cached_user_ratings_total_count;
ALTER TABLE model_weights DROP COLUMN cached_user_ratings_positive_count;
ALTER TABLE model_weights DROP COLUMN cached_user_ratings_negative_count;
ALTER TABLE model_weights DROP COLUMN maybe_cached_user_ratings_ratio;
ALTER TABLE model_weights DROP COLUMN cached_user_ratings_last_updated_at;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
DROP INDEX unique_index_user_type_token ON user_bookmarks;
@@ -0,0 +1,6 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
CREATE UNIQUE INDEX unique_index_user_type_token
ON user_bookmarks (user_token, entity_type, entity_token);
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE model_weights_extension_tts_details DROP COLUMN text_pipeline_type;
@@ -0,0 +1,7 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE model_weights_extension_tts_details
ADD COLUMN text_pipeline_type VARCHAR(64) DEFAULT NULL
AFTER ietf_primary_language_subtag;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
drop table idempotency_tokens;
@@ -0,0 +1,19 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- A form of optimistic locking
CREATE TABLE idempotency_tokens (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- This can be a UUID or any entropic value.
idempotency_value VARCHAR(36) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (idempotency_value)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
drop table batch_generations;
@@ -0,0 +1,42 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Batch generations
CREATE TABLE batch_generations (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- The batch token
-- This is **NOT** a unique token.
token VARCHAR(32) NOT NULL,
-- ========== ENTITY LINKAGE ==========
-- The type of record this is attached to
-- Currently supported values:
-- * 'model_weight'
-- * 'media_file'
-- * 'comment'
entity_type VARCHAR(32) NOT NULL,
-- The token for the record.
entity_token VARCHAR(32) NOT NULL,
-- ========== TIMESTAMPS ==========
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (token, entity_type, entity_token),
KEY index_token (token),
KEY index_entity_token (entity_token)
-- NB: Realistically, we probably don't need this index until we have a lot of entity types, and the entity_token
-- entropy is probably sufficient enough as-is.
-- KEY index_entity_type_and_token (entity_type, entity_token),
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
@@ -0,0 +1,5 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE media_files DROP COLUMN is_batch_generated;
@@ -0,0 +1,7 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
ALTER TABLE media_files
ADD COLUMN is_batch_generated BOOLEAN NOT NULL DEFAULT FALSE
AFTER maybe_origin_filename;
@@ -0,0 +1,42 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Batch generations
CREATE TABLE batch_generations (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- The batch token
-- This is **NOT** a unique token.
token VARCHAR(32) NOT NULL,
-- ========== ENTITY LINKAGE ==========
-- The type of record this is attached to
-- Currently supported values:
-- * 'model_weight'
-- * 'media_file'
-- * 'comment'
entity_type VARCHAR(32) NOT NULL,
-- The token for the record.
entity_token VARCHAR(32) NOT NULL,
-- ========== TIMESTAMPS ==========
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (token, entity_type, entity_token),
KEY index_token (token),
KEY index_entity_token (entity_token)
-- NB: Realistically, we probably don't need this index until we have a lot of entity types, and the entity_token
-- entropy is probably sufficient enough as-is.
-- KEY index_entity_type_and_token (entity_type, entity_token),
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+56
View File
@@ -0,0 +1,56 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Statistics about any entity. Typically model weights and media files.
CREATE TABLE entity_stats (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- ========== ENTITY LINKAGE ==========
-- The type of record this is attached to
-- Currently supported values:
-- * 'model_weight'
-- * 'media_file'
-- * 'comment'
entity_type VARCHAR(32) NOT NULL,
-- The token for the record.
entity_token VARCHAR(32) NOT NULL,
-- ========== MODEL DESCRIPTION ==========
-- Total positive ratings
-- Total overall ratings = positive + negative
ratings_positive_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- Total negative ratings
-- Total overall ratings = positive + negative
ratings_negative_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- Total number of user bookmarks
bookmark_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- Total number of views
-- view_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- Total number of views
-- play_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- ========== TIMESTAMPS ==========
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-- When the cached ratings were last calculated and updated.
-- maybe_last_backfilled_at TIMESTAMP DEFAULT NULL,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (entity_type, entity_token),
KEY index_entity_type (entity_type),
KEY index_entity_token (entity_token)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
@@ -0,0 +1,19 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- A form of optimistic locking
CREATE TABLE idempotency_tokens (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- This can be a UUID or any entropic value.
idempotency_value VARCHAR(36) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (idempotency_value)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+12 -2
View File
@@ -26,7 +26,7 @@ CREATE TABLE media_files (
-- * 'device_api' for direct user uploads recorded using Browser/Device APIs.
origin_category VARCHAR(16) NOT NULL,
-- TODO: Remove default value once records backfilled and queries updated.
-- TODO(bt,2024-01-12): Rename to origin_product.
-- Product area where the media file originated.
-- This is not the *model* that created the thing, this is the *product*.
-- (The underlying models can change over time.)
@@ -37,8 +37,13 @@ CREATE TABLE media_files (
-- "Voice Designer" dataset samples in a video generation flow.)
--
-- Possible values:
-- * 'unknown' for legacy records without an associated product
-- * 'face_animator' for uploads and outputs
-- * 'unknown' for legacy records without an associated product (TODO: This should be temporary)
-- * 'tts' for text to speech outputs
-- * 'voice_conversion' for uploads or outputs (RVC or SVC)
-- * 'zs_voice' for uploads or outputs for zero shot voice products
-- * 'video_filter' filters on videos
-- * 'mocap' for files uploaded or processed by motion capture
origin_product_category VARCHAR(16) NOT NULL DEFAULT "unknown",
-- For inference that can be tied back to a model, the type of model.
@@ -53,6 +58,11 @@ CREATE TABLE media_files (
-- The original filename of the media (if uploaded by a user)
maybe_origin_filename VARCHAR(255) DEFAULT NULL,
-- Whether this media file was generated as part of a batch
-- If so, we can look up the batch in a separate query/call to the `batch_generations` table.
-- We won't hold the batch token in this table since it'll be very sparsely populated.
is_batch_generated BOOLEAN NOT NULL DEFAULT FALSE,
-- ========== METADATA ==========
-- We can store text transcripts, etc. in other tables and refer back via foreign key.
@@ -39,23 +39,19 @@ CREATE TABLE model_weights (
-- The "name" of the model, which might be complicated.
title VARCHAR(255) NOT NULL,
-- TODO(bt, 2023-12-14): Delete the `maybe_thumbnail_token` column later.
-- We're using other columns instead.
maybe_thumbnail_token VARCHAR(32) DEFAULT NULL,
-- The "avatar" image is a media file of type image that serves as a
-- small avatar or profile picture icon.
maybe_avatar_media_file_token VARCHAR(32) DEFAULT NULL,
-- The "cover" image is a media file of type image that covers the
-- top of the page.
maybe_cover_media_file_token VARCHAR(32) DEFAULT NULL,
-- The "cover" image is a media file of type image that severs as a small
-- example of the model. Like album art or a user profile picture / avatar.
maybe_cover_image_media_file_token VARCHAR(32) DEFAULT NULL,
-- The description of the model in markdown.
description_markdown TEXT NOT NULL,
-- This is optional, since not all weights are of the same caliber (eg. zero shot models
-- don't deserve a description).
maybe_description_markdown TEXT DEFAULT NULL,
-- Generated HTML (not user-editable).
description_rendered_html TEXT NOT NULL,
-- This is optional, since not all weights are of the same caliber (eg. zero shot
-- models don't deserve a description).
maybe_description_rendered_html TEXT DEFAULT NULL,
-- ========== CREATOR DETAILS ==========
@@ -144,26 +140,6 @@ CREATE TABLE model_weights (
-- is_locked_from_user_modification BOOLEAN NOT NULL DEFAULT FALSE,
-- ========== RATING AND RANKING ==========
-- User ratings are cached on the model, but are *not* a source of truth.
-- Total count only includes "positive" and "negative" votes, not neutral ones.
cached_user_ratings_total_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- Total positive
cached_user_ratings_positive_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- Total negative
cached_user_ratings_negative_count INT(10) UNSIGNED NOT NULL DEFAULT 0,
-- User ratings are cached on the model, but are *not* a source of truth.
-- Total count only includes "positive" and "negative" votes, not neutral ones.
maybe_cached_user_ratings_ratio FLOAT,
-- When the cached ratings were last calculated and updated.
cached_user_ratings_last_updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-- ========== MIGRATION DETAILS ==========
-- If migrated from another table, this is the token of the original model.
@@ -194,7 +170,6 @@ CREATE TABLE model_weights (
KEY index_weights_category (weights_category),
KEY fk_creator_user_token (creator_user_token),
KEY index_creator_set_visibility (creator_set_visibility),
KEY fk_maybe_avatar_media_file_token (maybe_avatar_media_file_token),
KEY fk_maybe_cover_media_file_token (maybe_cover_media_file_token)
KEY fk_maybe_cover_media_file_token (maybe_cover_image_media_file_token)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
@@ -28,7 +28,7 @@ CREATE TABLE model_weights_extension_tts_details (
-- live in the `storyteller-ml` repository.
-- Older models and brand new models will have this field set to null, and we'll infer which value to
-- lazily backfill based on the creation date and language setting.
-- tts_text_pipeline_type VARCHAR(64) DEFAULT NULL,
text_pipeline_type VARCHAR(64) DEFAULT NULL,
-- If true, multiply the mel outputs before being vocoded by a globally default constant.
use_default_mel_multiply_factor BOOLEAN NOT NULL DEFAULT FALSE,
@@ -0,0 +1,47 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- Favorites that can be attached to just about anything.
-- This is a polymorphic table and can apply to a wide variety of entities.
CREATE TABLE user_bookmarks
(
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- Effective "primary key" (PUBLIC)
token VARCHAR(32) NOT NULL,
-- User making the favorite
user_token VARCHAR(32) NOT NULL,
-- The type of entity the favorite applies to
entity_type VARCHAR(32) NOT NULL,
-- The token of the entity the favorite applies to
entity_token VARCHAR(32) NOT NULL,
-- ========== VECTOR CLOCK ==========
-- Incremented with every update.
version INT NOT NULL DEFAULT 0,
-- ========== TIMESTAMPS ==========
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
deleted_at TIMESTAMP NULL,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (token),
UNIQUE KEY (user_token, entity_type, entity_token),
KEY index_entity_type_entity_token (entity_type, entity_token),
KEY index_user_token_entity_token (user_token, entity_type),
KEY index_user_token (user_token),
KEY index_created_at (created_at),
KEY index_user_deleted_at (deleted_at)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_bin;
+2 -1
View File
@@ -5,7 +5,8 @@
//!
// Never allow these
#![forbid(private_in_public)]
#![forbid(private_bounds)]
#![forbid(private_interfaces)]
#![forbid(unused_must_use)] // NB: It's unsafe to not close/check some things
// Okay to toggle
@@ -26,12 +26,14 @@ impl ModelCategory {
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum ModelType {
VallEx,
StyleTTS2,
}
impl ModelType {
pub fn to_str(&self) -> &'static str {
match self {
ModelType::VallEx => "vallex",
ModelType::StyleTTS2 => "styletts2",
}
}
}
@@ -25,6 +25,11 @@ impl PublicPath for WeightFileBucketPath {}
impl WeightFileBucketPath {
// TODO(bt,2024-01-14): This is temporary standardization. Clean this up.
pub fn generate_for_tt2_model() -> Self {
Self::generate_new(Some("tt2_"), Some(".pt"))
}
// TODO(bt,2023-12-19): This is temporary standardization. Clean this up.
pub fn generate_for_svc_model() -> Self {
Self::generate_new(Some("svc_"), Some(".pt"))
@@ -35,6 +40,11 @@ impl WeightFileBucketPath {
Self::generate_new(Some("rvc_"), Some(".pt"))
}
// TODO(bt,2024-01-15): This is temporary standardization. Clean this up.
pub fn tt2_model_file_from_object_hash(hash: &str) -> Self {
Self::from_object_hash(hash, Some("tt2_"), Some(".pt"))
}
// TODO(bt,2023-12-19): This is temporary standardization. Clean this up.
pub fn svc_model_file_from_object_hash(hash: &str) -> Self {
Self::from_object_hash(hash, Some("svc_"), Some(".pt"))
@@ -0,0 +1,40 @@
[package]
name = "composite_identifiers"
edition = "2018"
version = "0.0.1"
authors = [
"Brandon Thomas <bt@brand.io>",
"Brandon Thomas <echelon@gmail.com>",
]
publish = false
[lib]
name = "composite_identifiers"
path = "src/lib.rs"
[dependencies]
# Internal
enums = { path = "../enums" }
tokens = { path = "../tokens" }
# Workspace hack (faster compile times)
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
# Serialization
serde = "1.0.125"
serde_derive = "1.0.125"
sqlx = { version = "0.7.2", features = [ "mysql", "sqlite", "runtime-tokio-native-tls", "chrono" ] }
sqlx-core = { version = "0.7.2" }
sqlx-mysql= { version = "0.7.2" }
utoipa = { version = "4", features = ["chrono","actix_extras"] }
[dev-dependencies]
# Enum utilities
strum = { version = "0.25", features = ["derive"] }
# Test serialization
serde_json = "1.0.108"
toml = "0.5.8"
@@ -0,0 +1,28 @@
use enums::by_table::batch_generations::batch_generation_entity_type::BatchGenerationEntityType;
use tokens::tokens::media_files::MediaFileToken;
// TODO(bt, 2024-01-16): A ref type with <'a> lifetime of inner data instead of ownership?
pub enum BatchGenerationEntity {
MediaFile(MediaFileToken),
}
// TODO(bt, 2024-01-16): Codegen? Make traits for these? Maybe overkill.
impl BatchGenerationEntity {
pub fn get_entity_type(&self) -> BatchGenerationEntityType {
match self {
Self::MediaFile(_) => BatchGenerationEntityType::MediaFile,
}
}
pub fn get_entity_token_str(&self) -> &str {
match self {
Self::MediaFile(token) => token.as_str(),
}
}
pub fn get_composite_keys(&self) -> (BatchGenerationEntityType, &str) {
match self {
Self::MediaFile(token) => (BatchGenerationEntityType::MediaFile, token.as_str()),
}
}
}
@@ -0,0 +1 @@
pub mod batch_generation_entity;
@@ -0,0 +1 @@
pub mod batch_generations;
@@ -0,0 +1,22 @@
//! composite_identifiers
//!
//! The purpose of this library is to provide easy to construct, **typesafe**, composite identifiers.
//! This is mostly a combination of `tokens` and `enums`.
//!
// Never allow these
#![forbid(private_bounds)]
#![forbid(private_interfaces)]
#![forbid(unused_must_use)] // NB: It's unsafe to not close/check some things
// Okay to toggle
#![forbid(unreachable_patterns)]
#![forbid(unused_imports)]
#![forbid(unused_mut)]
#![forbid(unused_variables)]
// Always allow
#![allow(dead_code)]
#![allow(non_snake_case)]
pub mod by_table;
@@ -0,0 +1,109 @@
use std::collections::BTreeSet;
use serde::Deserialize;
use serde::Serialize;
#[cfg(test)]
use strum::EnumCount;
#[cfg(test)]
use strum::EnumIter;
use utoipa::ToSchema;
/// Used in the `batch_generations` table in a `VARCHAR(32)` field named `entity_type`.
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Hash, Deserialize, Serialize, Ord, PartialOrd, ToSchema)]
pub enum BatchGenerationEntityType {
/// Media files
/// This will probably be the only type supported, but we'll leave the possibility of future types.
#[serde(rename = "media_file")]
MediaFile,
}
// TODO(bt, 2023-01-17): This desperately needs MySQL integration tests!
impl_enum_display_and_debug_using_to_str!(BatchGenerationEntityType);
impl_mysql_enum_coders!(BatchGenerationEntityType);
impl_mysql_from_row!(BatchGenerationEntityType);
/// NB: Legacy API for older code.
impl BatchGenerationEntityType {
pub fn to_str(&self) -> &'static str {
match self {
Self::MediaFile => "media_file",
}
}
pub fn from_str(value: &str) -> Result<Self, String> {
match value {
"media_file" => Ok(Self::MediaFile),
_ => Err(format!("invalid value: {:?}", value)),
}
}
pub fn all_variants() -> BTreeSet<Self> {
// NB: BTreeSet is sorted
// NB: BTreeSet::from() isn't const, but not worth using LazyStatic, etc.
BTreeSet::from([
Self::MediaFile,
])
}
}
#[cfg(test)]
mod tests {
use crate::by_table::batch_generations::batch_generation_entity_type::BatchGenerationEntityType;
use crate::test_helpers::assert_serialization;
mod serde {
use super::*;
#[test]
fn test_serialization() {
assert_serialization(BatchGenerationEntityType::MediaFile, "media_file");
}
}
mod impl_methods {
use super::*;
#[test]
fn to_str() {
assert_eq!(BatchGenerationEntityType::MediaFile.to_str(), "media_file");
}
#[test]
fn from_str() {
assert_eq!(BatchGenerationEntityType::from_str("media_file").unwrap(), BatchGenerationEntityType::MediaFile);
assert!(BatchGenerationEntityType::from_str("foo").is_err());
}
}
mod manual_variant_checks {
use super::*;
#[test]
fn all_variants() {
let mut variants = BatchGenerationEntityType::all_variants();
assert_eq!(variants.len(), 1);
assert_eq!(variants.pop_first(), Some(BatchGenerationEntityType::MediaFile));
assert_eq!(variants.pop_first(), None);
}
}
mod mechanical_checks {
use super::*;
#[test]
fn variant_length() {
use strum::IntoEnumIterator;
assert_eq!(BatchGenerationEntityType::all_variants().len(), BatchGenerationEntityType::iter().len());
}
#[test]
fn round_trip() {
for variant in BatchGenerationEntityType::all_variants() {
assert_eq!(variant, BatchGenerationEntityType::from_str(variant.to_str()).unwrap());
assert_eq!(variant, BatchGenerationEntityType::from_str(&format!("{}", variant)).unwrap());
assert_eq!(variant, BatchGenerationEntityType::from_str(&format!("{:?}", variant)).unwrap());
}
}
}
}
@@ -0,0 +1 @@
pub mod batch_generation_entity_type;
@@ -0,0 +1 @@
pub mod stats_entity_type;
@@ -0,0 +1,121 @@
use std::collections::BTreeSet;
use serde::Deserialize;
use serde::Serialize;
#[cfg(test)]
use strum::EnumCount;
#[cfg(test)]
use strum::EnumIter;
use utoipa::ToSchema;
/// Used in the `user_stats` table in a `VARCHAR(32)` field named `entity_type`.
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Hash, Deserialize, Serialize, ToSchema, Ord, PartialOrd)]
pub enum StatsEntityType {
/// Comment
#[serde(rename = "comment")]
Comment,
/// MediaFile
#[serde(rename = "media_file")]
MediaFile,
/// ModelWeight (the new way to store models)
#[serde(rename = "model_weight")]
ModelWeight,
}
// TODO(bt, 2023-01-17): This desperately needs MySQL integration tests!
impl_enum_display_and_debug_using_to_str!(StatsEntityType);
impl_mysql_enum_coders!(StatsEntityType);
impl_mysql_from_row!(StatsEntityType);
/// NB: Legacy API for older code.
impl StatsEntityType {
pub fn to_str(&self) -> &'static str {
match self {
Self::Comment => "comment",
Self::MediaFile => "media_file",
Self::ModelWeight => "model_weight",
}
}
pub fn from_str(value: &str) -> Result<Self, String> {
match value {
"comment" => Ok(Self::Comment),
"media_file" => Ok(Self::MediaFile),
"model_weight" => Ok(Self::ModelWeight),
_ => Err(format!("invalid value: {:?}", value)),
}
}
pub fn all_variants() -> BTreeSet<Self> {
// NB: BTreeSet is sorted
// NB: BTreeSet::from() isn't const, but not worth using LazyStatic, etc.
BTreeSet::from([
Self::Comment,
Self::MediaFile,
Self::ModelWeight,
])
}
}
#[cfg(test)]
mod tests {
use crate::by_table::entity_stats::stats_entity_type::StatsEntityType;
use crate::test_helpers::assert_serialization;
mod explicit_checks {
use super::*;
#[test]
fn test_serialization() {
assert_serialization(StatsEntityType::Comment, "comment");
assert_serialization(StatsEntityType::MediaFile, "media_file");
assert_serialization(StatsEntityType::ModelWeight, "model_weight");
}
#[test]
fn test_to_str() {
assert_eq!(StatsEntityType::Comment.to_str(), "comment");
assert_eq!(StatsEntityType::MediaFile.to_str(), "media_file");
assert_eq!(StatsEntityType::ModelWeight.to_str(), "model_weight");
}
#[test]
fn test_from_str() {
assert_eq!(StatsEntityType::from_str("comment").unwrap(), StatsEntityType::Comment);
assert_eq!(StatsEntityType::from_str("media_file").unwrap(), StatsEntityType::MediaFile);
assert_eq!(StatsEntityType::from_str("model_weight").unwrap(), StatsEntityType::ModelWeight);
assert!(StatsEntityType::from_str("foo").is_err());
}
#[test]
fn all_variants() {
let mut variants = StatsEntityType::all_variants();
assert_eq!(variants.len(), 3);
assert_eq!(variants.pop_first(), Some(StatsEntityType::Comment));
assert_eq!(variants.pop_first(), Some(StatsEntityType::MediaFile));
assert_eq!(variants.pop_first(), Some(StatsEntityType::ModelWeight));
assert_eq!(variants.pop_first(), None);
}
}
mod mechanical_checks {
use super::*;
#[test]
fn variant_length() {
use strum::IntoEnumIterator;
assert_eq!(StatsEntityType::all_variants().len(), StatsEntityType::iter().len());
}
#[test]
fn round_trip() {
for variant in StatsEntityType::all_variants() {
assert_eq!(variant, StatsEntityType::from_str(variant.to_str()).unwrap());
assert_eq!(variant, StatsEntityType::from_str(&format!("{}", variant)).unwrap());
assert_eq!(variant, StatsEntityType::from_str(&format!("{:?}", variant)).unwrap());
}
}
}
}
@@ -28,6 +28,9 @@ pub enum InferenceCategory {
#[serde(rename = "video_filter")]
VideoFilter,
#[serde(rename = "mocap")]
Mocap,
}
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
@@ -42,6 +45,7 @@ impl InferenceCategory {
Self::TextToSpeech => "text_to_speech",
Self::VoiceConversion => "voice_conversion",
Self::VideoFilter => "video_filter",
Self::Mocap => "mocap",
}
}
@@ -51,6 +55,7 @@ impl InferenceCategory {
"text_to_speech" => Ok(Self::TextToSpeech),
"voice_conversion" => Ok(Self::VoiceConversion),
"video_filter" => Ok(Self::VideoFilter),
"mocap" => Ok(Self::Mocap),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -63,6 +68,7 @@ impl InferenceCategory {
Self::TextToSpeech,
Self::VoiceConversion,
Self::VideoFilter,
Self::Mocap,
])
}
}
@@ -78,6 +84,7 @@ mod tests {
assert_serialization(InferenceCategory::TextToSpeech, "text_to_speech");
assert_serialization(InferenceCategory::VoiceConversion, "voice_conversion");
assert_serialization(InferenceCategory::VideoFilter, "video_filter");
assert_serialization(InferenceCategory::Mocap, "mocap")
}
#[test]
@@ -86,6 +93,7 @@ mod tests {
assert_eq!(InferenceCategory::TextToSpeech.to_str(), "text_to_speech");
assert_eq!(InferenceCategory::VoiceConversion.to_str(), "voice_conversion");
assert_eq!(InferenceCategory::VideoFilter.to_str(), "video_filter");
assert_eq!(InferenceCategory::Mocap.to_str(), "mocap");
}
#[test]
@@ -94,17 +102,19 @@ mod tests {
assert_eq!(InferenceCategory::from_str("text_to_speech").unwrap(), InferenceCategory::TextToSpeech);
assert_eq!(InferenceCategory::from_str("voice_conversion").unwrap(), InferenceCategory::VoiceConversion);
assert_eq!(InferenceCategory::from_str("video_filter").unwrap(), InferenceCategory::VideoFilter);
assert_eq!(InferenceCategory::from_str("mocap").unwrap(), InferenceCategory::Mocap);
}
#[test]
fn all_variants() {
// Static check
let mut variants = InferenceCategory::all_variants();
assert_eq!(variants.len(), 4);
assert_eq!(variants.len(), 5);
assert_eq!(variants.pop_first(), Some(InferenceCategory::LipsyncAnimation));
assert_eq!(variants.pop_first(), Some(InferenceCategory::TextToSpeech));
assert_eq!(variants.pop_first(), Some(InferenceCategory::VoiceConversion));
assert_eq!(variants.pop_first(), Some(InferenceCategory::VideoFilter));
assert_eq!(variants.pop_first(), Some(InferenceCategory::Mocap));
assert_eq!(variants.pop_first(), None);
// Generated check
@@ -33,6 +33,10 @@ pub enum InferenceModelType {
VallEX,
#[serde(rename = "rerender_a_video")]
RerenderAVideo,
#[serde(rename = "mocap_net")]
MocapNet,
#[serde(rename = "styletts2")]
StyleTTS2,
}
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
@@ -50,6 +54,8 @@ impl InferenceModelType {
Self::Vits => "vits",
Self::VallEX => "vall_e_x",
Self::RerenderAVideo => "rerender_a_video",
Self::MocapNet => "mocap_net",
Self::StyleTTS2 => "styletts2",
}
}
@@ -62,6 +68,8 @@ impl InferenceModelType {
"vits" => Ok(Self::Vits),
"vall_e_x" => Ok(Self::VallEX),
"rerender_a_video" => Ok(Self::RerenderAVideo),
"mocap_net" => Ok(Self::MocapNet),
"styletts2" => Ok(Self::StyleTTS2),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -76,7 +84,9 @@ impl InferenceModelType {
InferenceModelType::Tacotron2,
InferenceModelType::Vits,
InferenceModelType::VallEX,
InferenceModelType::RerenderAVideo
InferenceModelType::RerenderAVideo,
InferenceModelType::MocapNet,
InferenceModelType::StyleTTS2,
])
}
}
@@ -95,6 +105,8 @@ mod tests {
assert_serialization(InferenceModelType::Vits, "vits");
assert_serialization(InferenceModelType::VallEX, "vall_e_x");
assert_serialization(InferenceModelType::RerenderAVideo, "rerender_a_video");
assert_serialization(InferenceModelType::MocapNet, "mocap_net");
assert_serialization(InferenceModelType::StyleTTS2, "styletts2");
}
#[test]
@@ -106,6 +118,8 @@ mod tests {
assert_eq!(InferenceModelType::Vits.to_str(), "vits");
assert_eq!(InferenceModelType::VallEX.to_str(), "vall_e_x");
assert_eq!(InferenceModelType::RerenderAVideo.to_str(), "rerender_a_video");
assert_eq!(InferenceModelType::MocapNet.to_str(), "mocap_net");
assert_eq!(InferenceModelType::StyleTTS2.to_str(), "styletts2");
}
#[test]
@@ -117,13 +131,15 @@ mod tests {
assert_eq!(InferenceModelType::from_str("vits").unwrap(), InferenceModelType::Vits);
assert_eq!(InferenceModelType::from_str("vall_e_x").unwrap(), InferenceModelType::VallEX);
assert_eq!(InferenceModelType::from_str("rerender_a_video").unwrap(), InferenceModelType::RerenderAVideo);
assert_eq!(InferenceModelType::from_str("mocap_net").unwrap(), InferenceModelType::MocapNet);
assert_eq!(InferenceModelType::from_str("styletts2").unwrap(), InferenceModelType::StyleTTS2);
}
#[test]
fn all_variants() {
// Static check
let mut variants = InferenceModelType::all_variants();
assert_eq!(variants.len(), 7);
assert_eq!(variants.len(), 9);
assert_eq!(variants.pop_first(), Some(InferenceModelType::RvcV2));
assert_eq!(variants.pop_first(), Some(InferenceModelType::SadTalker));
assert_eq!(variants.pop_first(), Some(InferenceModelType::SoVitsSvc));
@@ -131,6 +147,8 @@ mod tests {
assert_eq!(variants.pop_first(), Some(InferenceModelType::Vits));
assert_eq!(variants.pop_first(), Some(InferenceModelType::VallEX));
assert_eq!(variants.pop_first(), Some(InferenceModelType::RerenderAVideo));
assert_eq!(variants.pop_first(), Some(InferenceModelType::MocapNet));
assert_eq!(variants.pop_first(), Some(InferenceModelType::StyleTTS2));
assert_eq!(variants.pop_first(), None);
// Generated check
@@ -25,6 +25,10 @@ pub enum IdCategory {
#[serde(rename = "video_filter")]
VideoFilterResult,
// Results from mocap
#[serde(rename = "mocap")]
MocapResult,
/// Results from tacotron2
/// Applies for RVC and SVC
#[serde(rename = "tts_result")]
@@ -73,6 +77,7 @@ impl IdCategory {
Self::VideoFilterResult => "video_filter",
Self::ModelWeights => "model_weights",
Self::FileUpload => "file_upload",
Self::MocapResult => "mocap",
}
}
@@ -88,6 +93,7 @@ impl IdCategory {
"video_filter" => Ok(Self::VideoFilterResult),
"model_weights" => Ok(Self::ModelWeights),
"file_upload" => Ok(Self::FileUpload),
"mocap" => Ok(Self::MocapResult),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -106,6 +112,7 @@ impl IdCategory {
Self::ZeroShotVoiceEmbedding,
Self::ModelWeights,
Self::FileUpload,
Self::MocapResult,
])
}
}
@@ -130,6 +137,7 @@ mod tests {
assert_serialization(IdCategory::ZeroShotTtsResult, "zs_tts_result");
assert_serialization(IdCategory::ModelWeights, "model_weights");
assert_serialization(IdCategory::FileUpload, "file_upload");
assert_serialization(IdCategory::MocapResult, "mocap");
}
#[test]
@@ -144,6 +152,7 @@ mod tests {
assert_eq!(IdCategory::ZeroShotTtsResult.to_str(), "zs_tts_result");
assert_eq!(IdCategory::ModelWeights.to_str(), "model_weights");
assert_eq!(IdCategory::FileUpload.to_str(), "file_upload");
assert_eq!(IdCategory::MocapResult.to_str(), "mocap");
}
#[test]
@@ -158,16 +167,18 @@ mod tests {
assert_eq!(IdCategory::from_str("zs_tts_result").unwrap(), IdCategory::ZeroShotTtsResult);
assert_eq!(IdCategory::from_str("model_weights").unwrap(), IdCategory::ModelWeights);
assert_eq!(IdCategory::from_str("file_upload").unwrap(), IdCategory::FileUpload);
assert_eq!(IdCategory::from_str("mocap").unwrap(), IdCategory::MocapResult);
}
#[test]
fn all_variants() {
// Static check
let mut variants = IdCategory::all_variants();
assert_eq!(variants.len(), 10);
assert_eq!(variants.len(), 11);
assert_eq!(variants.pop_first(), Some(IdCategory::MediaFile));
assert_eq!(variants.pop_first(), Some(IdCategory::LipsyncAnimationResult));
assert_eq!(variants.pop_first(), Some(IdCategory::VideoFilterResult));
assert_eq!(variants.pop_first(), Some(IdCategory::MocapResult));
assert_eq!(variants.pop_first(), Some(IdCategory::TtsResult));
assert_eq!(variants.pop_first(), Some(IdCategory::VoiceConversionResult));
assert_eq!(variants.pop_first(), Some(IdCategory::ZeroShotTtsResult));
@@ -20,6 +20,7 @@ pub enum MediaFileOriginModelType {
RvcV2,
/// SadTalker -- v1, we may add another enum value for future versions
#[serde(rename = "sad_talker")]
SadTalker,
/// so-vits-svc voice conversion models
@@ -34,6 +35,12 @@ pub enum MediaFileOriginModelType {
#[serde(rename = "rerender")]
Rerender,
#[serde(rename = "mocap_net")]
MocapNet,
#[serde(rename = "styletts2")]
StyleTTS2,
}
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
@@ -51,6 +58,8 @@ impl MediaFileOriginModelType {
Self::Tacotron2 => "tacotron2",
Self::VallEX => "vall_e_x",
Self::Rerender => "rerender",
Self::MocapNet => "mocap_net",
Self::StyleTTS2 => "styletts2",
}
}
@@ -62,6 +71,8 @@ impl MediaFileOriginModelType {
"tacotron2" => Ok(Self::Tacotron2),
"vall_e_x" => Ok(Self::VallEX),
"rerender" => Ok(Self::Rerender),
"mocap_net" => Ok(Self::MocapNet),
"styletts2" => Ok(Self::StyleTTS2),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -76,6 +87,8 @@ impl MediaFileOriginModelType {
Self::Tacotron2,
Self::VallEX,
Self::Rerender,
Self::MocapNet,
Self::StyleTTS2,
])
}
}
@@ -101,6 +114,8 @@ mod tests {
assert_eq!(MediaFileOriginModelType::Tacotron2.to_str(), "tacotron2");
assert_eq!(MediaFileOriginModelType::VallEX.to_str(), "vall_e_x");
assert_eq!(MediaFileOriginModelType::Rerender.to_str(), "rerender");
assert_eq!(MediaFileOriginModelType::MocapNet.to_str(), "mocap_net");
assert_eq!(MediaFileOriginModelType::StyleTTS2.to_str(), "styletts2");
}
#[test]
@@ -111,19 +126,23 @@ mod tests {
assert_eq!(MediaFileOriginModelType::from_str("tacotron2").unwrap(), MediaFileOriginModelType::Tacotron2);
assert_eq!(MediaFileOriginModelType::from_str("vall_e_x").unwrap(), MediaFileOriginModelType::VallEX);
assert_eq!(MediaFileOriginModelType::from_str("rerender").unwrap(), MediaFileOriginModelType::Rerender);
assert_eq!(MediaFileOriginModelType::from_str("mocap_net").unwrap(), MediaFileOriginModelType::MocapNet);
assert_eq!(MediaFileOriginModelType::from_str("styletts2").unwrap(), MediaFileOriginModelType::StyleTTS2);
assert!(MediaFileOriginModelType::from_str("foo").is_err());
}
#[test]
fn all_variants() {
let mut variants = MediaFileOriginModelType::all_variants();
assert_eq!(variants.len(), 6);
assert_eq!(variants.len(), 8);
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::RvcV2));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::SadTalker));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::SoVitsSvc));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::Tacotron2));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::VallEX));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::Rerender));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::MocapNet));
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::StyleTTS2));
assert_eq!(variants.pop_first(), None);
}
}
@@ -17,6 +17,11 @@ use utoipa::ToSchema;
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, ToSchema)]
pub enum MediaFileOriginProductCategory {
/// Unknown which product is attached to the file (generated the file, the file was
/// uploaded on behalf of, etc.)
#[serde(rename = "unknown")]
Unknown,
/// Media files created by (or uploaded for) the Face Animator product.
/// The underlying model could be SadTalker, Wav2Lip, or some future model
#[serde(rename = "face_animator")]
@@ -26,12 +31,6 @@ pub enum MediaFileOriginProductCategory {
#[serde(rename = "tts")]
TextToSpeech,
// TODO: This should be a temporary category until we migrate the DB to remove this default value
/// Unknown which product is attached to the file (generated the file, the file was
/// uploaded on behalf of, etc.)
#[serde(rename = "unknown")]
Unknown,
/// Voice conversion (either RVC or SVC)
#[serde(rename = "voice_conversion")]
VoiceConversion,
@@ -43,6 +42,10 @@ pub enum MediaFileOriginProductCategory {
// Media files for video filters
#[serde(rename = "video_filter")]
VideoFilter,
// Mocap
#[serde(rename = "mocap")]
Mocap,
}
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
@@ -54,23 +57,25 @@ impl_mysql_from_row!(MediaFileOriginProductCategory);
impl MediaFileOriginProductCategory {
pub fn to_str(&self) -> &'static str {
match self {
Self::Unknown => "unknown",
Self::FaceAnimator => "face_animator",
Self::TextToSpeech => "tts",
Self::Unknown => "unknown",
Self::VoiceConversion => "voice_conversion",
Self::ZeroShotVoice => "zs_voice",
Self::VideoFilter => "video_filter",
Self::Mocap => "mocap",
}
}
pub fn from_str(value: &str) -> Result<Self, String> {
match value {
"unknown" => Ok(Self::Unknown),
"face_animator" => Ok(Self::FaceAnimator),
"tts" => Ok(Self::TextToSpeech),
"unknown" => Ok(Self::Unknown),
"voice_conversion" => Ok(Self::VoiceConversion),
"zs_voice" => Ok(Self::ZeroShotVoice),
"video_filter" => Ok(Self::VideoFilter),
"mocap" => Ok(Self::Mocap),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -79,12 +84,13 @@ impl MediaFileOriginProductCategory {
// NB: BTreeSet is sorted
// NB: BTreeSet::from() isn't const, but not worth using LazyStatic, etc.
BTreeSet::from([
Self::Unknown,
Self::FaceAnimator,
Self::TextToSpeech,
Self::VideoFilter,
Self::Unknown,
Self::VoiceConversion,
Self::ZeroShotVoice,
Self::Mocap,
])
}
}
@@ -99,44 +105,48 @@ mod tests {
#[test]
fn test_serialization() {
assert_serialization(MediaFileOriginProductCategory::Unknown, "unknown");
assert_serialization(MediaFileOriginProductCategory::FaceAnimator, "face_animator");
assert_serialization(MediaFileOriginProductCategory::TextToSpeech, "tts");
assert_serialization(MediaFileOriginProductCategory::Unknown, "unknown");
assert_serialization(MediaFileOriginProductCategory::VoiceConversion, "voice_conversion");
assert_serialization(MediaFileOriginProductCategory::ZeroShotVoice, "zs_voice");
assert_serialization(MediaFileOriginProductCategory::VideoFilter, "video_filter")
assert_serialization(MediaFileOriginProductCategory::VideoFilter, "video_filter");
assert_serialization(MediaFileOriginProductCategory::Mocap, "mocap")
}
#[test]
fn to_str() {
assert_eq!(MediaFileOriginProductCategory::Unknown.to_str(), "unknown");
assert_eq!(MediaFileOriginProductCategory::FaceAnimator.to_str(), "face_animator");
assert_eq!(MediaFileOriginProductCategory::TextToSpeech.to_str(), "tts");
assert_eq!(MediaFileOriginProductCategory::Unknown.to_str(), "unknown");
assert_eq!(MediaFileOriginProductCategory::VoiceConversion.to_str(), "voice_conversion");
assert_eq!(MediaFileOriginProductCategory::ZeroShotVoice.to_str(), "zs_voice");
assert_eq!(MediaFileOriginProductCategory::VideoFilter.to_str(), "video_filter");
assert_eq!(MediaFileOriginProductCategory::Mocap.to_str(), "mocap");
}
#[test]
fn from_str() {
assert_eq!(MediaFileOriginProductCategory::from_str("unknown").unwrap(), MediaFileOriginProductCategory::Unknown);
assert_eq!(MediaFileOriginProductCategory::from_str("face_animator").unwrap(), MediaFileOriginProductCategory::FaceAnimator);
assert_eq!(MediaFileOriginProductCategory::from_str("tts").unwrap(), MediaFileOriginProductCategory::TextToSpeech);
assert_eq!(MediaFileOriginProductCategory::from_str("unknown").unwrap(), MediaFileOriginProductCategory::Unknown);
assert_eq!(MediaFileOriginProductCategory::from_str("voice_conversion").unwrap(), MediaFileOriginProductCategory::VoiceConversion);
assert_eq!(MediaFileOriginProductCategory::from_str("zs_voice").unwrap(), MediaFileOriginProductCategory::ZeroShotVoice);
assert_eq!(MediaFileOriginProductCategory::from_str("video_filter").unwrap(), MediaFileOriginProductCategory::VideoFilter);
assert_eq!(MediaFileOriginProductCategory::from_str("mocap").unwrap(), MediaFileOriginProductCategory::Mocap);
}
#[test]
fn all_variants() {
let mut variants = MediaFileOriginProductCategory::all_variants();
assert_eq!(variants.len(), 6);
assert_eq!(variants.len(), 7);
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::Unknown));
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::FaceAnimator));
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::TextToSpeech));
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::Unknown));
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::VoiceConversion));
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::ZeroShotVoice));
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::VideoFilter));
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::Mocap));
assert_eq!(variants.pop_first(), None);
}
}
@@ -21,6 +21,9 @@ pub enum MediaFileType {
/// Video files: mp4, etc.
Video,
/// Mocap files: BVH, etc.
Mocap,
}
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
@@ -35,6 +38,7 @@ impl MediaFileType {
Self::Audio => "audio",
Self::Image => "image",
Self::Video => "video",
Self::Mocap => "mocap",
}
}
@@ -43,6 +47,7 @@ impl MediaFileType {
"audio" => Ok(Self::Audio),
"image" => Ok(Self::Image),
"video" => Ok(Self::Video),
"mocap" => Ok(Self::Mocap),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -54,6 +59,7 @@ impl MediaFileType {
Self::Audio,
Self::Image,
Self::Video,
Self::Mocap,
])
}
}
@@ -71,6 +77,7 @@ mod tests {
assert_serialization(MediaFileType::Audio, "audio");
assert_serialization(MediaFileType::Image, "image");
assert_serialization(MediaFileType::Video, "video");
assert_serialization(MediaFileType::Mocap, "mocap");
}
}
@@ -82,6 +89,7 @@ mod tests {
assert_eq!(MediaFileType::Audio.to_str(), "audio");
assert_eq!(MediaFileType::Image.to_str(), "image");
assert_eq!(MediaFileType::Video.to_str(), "video");
assert_eq!(MediaFileType::Mocap.to_str(), "mocap");
}
#[test]
@@ -89,6 +97,7 @@ mod tests {
assert_eq!(MediaFileType::from_str("audio").unwrap(), MediaFileType::Audio);
assert_eq!(MediaFileType::from_str("image").unwrap(), MediaFileType::Image);
assert_eq!(MediaFileType::from_str("video").unwrap(), MediaFileType::Video);
assert_eq!(MediaFileType::from_str("mocap").unwrap(), MediaFileType::Mocap);
assert!(MediaFileType::from_str("foo").is_err());
}
}
@@ -99,10 +108,11 @@ mod tests {
#[test]
fn all_variants() {
let mut variants = MediaFileType::all_variants();
assert_eq!(variants.len(), 3);
assert_eq!(variants.len(), 4);
assert_eq!(variants.pop_first(), Some(MediaFileType::Audio));
assert_eq!(variants.pop_first(), Some(MediaFileType::Image));
assert_eq!(variants.pop_first(), Some(MediaFileType::Video));
assert_eq!(variants.pop_first(), Some(MediaFileType::Mocap));
assert_eq!(variants.pop_first(), None);
}
}
+4 -1
View File
@@ -1,13 +1,16 @@
// ===== MySql =====
pub mod audit_logs;
pub mod batch_generations;
pub mod comments;
pub mod email_sender_jobs;
pub mod entity_stats;
pub mod generic_download_jobs;
pub mod generic_inference_jobs;
pub mod generic_synthetic_ids;
pub mod media_files;
pub mod media_uploads;
pub mod model_categories;
pub mod model_weights;
pub mod trending_model_analytics;
pub mod tts_models;
pub mod user_bookmarks;
@@ -15,7 +18,7 @@ pub mod user_ratings;
pub mod voice_conversion_models;
pub mod voice_conversion_results;
pub mod zs_voices;
pub mod model_weights;
// ===== Sqlite =====
pub mod tts_render_tasks;
pub mod web_rendition_targets;
@@ -50,6 +50,7 @@ pub enum UserBookmarkEntityType {
// TODO(bt, 2023-01-17): This desperately needs MySQL integration tests!
impl_enum_display_and_debug_using_to_str!(UserBookmarkEntityType);
impl_mysql_enum_coders!(UserBookmarkEntityType);
impl_mysql_from_row!(UserBookmarkEntityType);
/// NB: Legacy API for older code.
impl UserBookmarkEntityType {
@@ -4,10 +4,11 @@ use serde::Serialize;
use strum::EnumCount;
#[cfg(test)]
use strum::EnumIter;
use utoipa::ToSchema;
/// Used in the `user_ratings` table in a `VARCHAR(32)` field named `entity_type`.
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Hash, Deserialize, Serialize)]
#[derive(Clone, Copy, Eq, PartialEq, Hash, Deserialize, Serialize, ToSchema)]
pub enum UserRatingEntityType {
/// Media files (inference results, uploads, etc.)
#[serde(rename = "media_file")]
@@ -2,6 +2,7 @@
use strum::EnumCount;
#[cfg(test)]
use strum::EnumIter;
use utoipa::ToSchema;
/// UserRatingValue
///
@@ -17,7 +18,7 @@ use strum::EnumIter;
/// *DO NOT CHANGE VALUES WITHOUT A MIGRATION STRATEGY!*
///
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Deserialize, Serialize, sqlx::Type)]
#[derive(Clone, Copy, Eq, PartialEq, Deserialize, Serialize, sqlx::Type, ToSchema)]
#[serde(rename_all = "lowercase")]
#[sqlx(rename_all = "lowercase")]
pub enum UserRatingValue {
@@ -16,6 +16,8 @@ pub enum ZsVoiceModelType {
/// TTS-type zero shot models
#[serde(rename = "vall-e-x")]
VallEX,
#[serde(rename = "styletts2")]
StyleTTS2,
}
// TODO(bt, 2023-01-17): This desperately needs MySQL integration tests!
@@ -27,12 +29,14 @@ impl ZsVoiceModelType {
pub fn to_str(&self) -> &'static str {
match self {
Self::VallEX=> "vall-e-x",
Self::StyleTTS2 => "styletts2",
}
}
pub fn from_str(value: &str) -> Result<Self, String> {
match value {
"vall-e-x" => Ok(Self::VallEX),
"styletts2" => Ok(Self::StyleTTS2),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -42,6 +46,7 @@ impl ZsVoiceModelType {
// NB: BTreeSet::from() isn't const, but not worth using LazyStatic, etc.
BTreeSet::from([
Self::VallEX,
Self::StyleTTS2,
])
}
}
@@ -66,11 +71,13 @@ mod tests {
#[test]
fn to_str() {
assert_eq!(ZsVoiceModelType::VallEX.to_str(), "vall-e-x");
assert_eq!(ZsVoiceModelType::StyleTTS2.to_str(), "styletts2");
}
#[test]
fn from_str() {
assert_eq!(ZsVoiceModelType::from_str("vall-e-x").unwrap(), ZsVoiceModelType::VallEX);
assert_eq!(ZsVoiceModelType::from_str("styletts2").unwrap(), ZsVoiceModelType::StyleTTS2);
assert!(ZsVoiceModelType::from_str("foo").is_err());
}
}
@@ -81,8 +88,9 @@ mod tests {
#[test]
fn all_variants() {
let mut variants = ZsVoiceModelType::all_variants();
assert_eq!(variants.len(), 1);
assert_eq!(variants.len(), 2);
assert_eq!(variants.pop_first(), Some(ZsVoiceModelType::VallEX));
assert_eq!(variants.pop_first(), Some(ZsVoiceModelType::StyleTTS2));
assert_eq!(variants.pop_first(), None);
}
}
+1
View File
@@ -3,3 +3,4 @@ pub mod job_status_plus;
pub mod sqlite;
pub mod visibility;
pub mod vocoder_type;
pub mod view_as;
+153
View File
@@ -0,0 +1,153 @@
#[cfg(test)]
use strum::EnumCount;
#[cfg(test)]
use strum::EnumIter;
use utoipa::ToSchema;
#[cfg_attr(test, derive(EnumIter, EnumCount))]
#[derive(Clone, Copy, Eq, PartialEq, Deserialize, Serialize, sqlx::Type,ToSchema)]
#[serde(rename_all = "snake_case")]
#[sqlx(rename_all = "snake_case")]
pub enum ViewAs {
/// Public entities are able to be listed in public lists.
/// It does not mean that they necessarily will be (eg. they could be "mod unapproved" or deleted).
Author,
/// Hidden entities are not shown in public lists, but the URL to them may be given out freely.
/// They are available to non-logged-in users as long as they have the URL.
Moderator,
/// Private entities should only be available to the creator, a list of approved users, and
/// website moderation staff.
AnotherUser,
}
impl_enum_display_and_debug_using_to_str!(ViewAs);
impl_mysql_from_row!(ViewAs);
impl Default for ViewAs {
fn default() -> Self { Self::AnotherUser }
}
/// NB: Legacy API for older code.
impl ViewAs {
pub fn to_str(&self) -> &'static str {
match self {
Self::Author => "author",
Self::Moderator => "moderator",
Self::AnotherUser => "another_user",
}
}
pub fn from_str(value: &str) -> Result<Self, String> {
match value {
"author" => Ok(Self::Author),
"moderator" => Ok(Self::Moderator),
"another_user" => Ok(Self::AnotherUser),
_ => Err(format!("invalid value: {:?}", value)),
}
}
}
#[cfg(test)]
mod tests {
use crate::common::view_as::ViewAs;
use crate::test_helpers::assert_serialization;
#[test]
fn test_default() {
assert_eq!(ViewAs::default(), ViewAs::AnotherUser);
}
#[test]
fn test_serialization() {
assert_serialization(ViewAs::Author, "author");
assert_serialization(ViewAs::Moderator, "moderator");
assert_serialization(ViewAs::AnotherUser, "another_user");
}
#[test]
fn test_to_str() {
assert_eq!(ViewAs::Author.to_str(), "author");
assert_eq!(ViewAs::Moderator.to_str(), "moderator");
assert_eq!(ViewAs::AnotherUser.to_str(), "another_user");
}
#[test]
fn test_from_str() {
assert_eq!(ViewAs::from_str("author").unwrap(), ViewAs::Author);
assert_eq!(ViewAs::from_str("moderator").unwrap(), ViewAs::Moderator);
assert_eq!(ViewAs::from_str("another_user").unwrap(), ViewAs::AnotherUser);
assert!(ViewAs::from_str("foo").is_err());
}
mod traits {
use crate::common::view_as::ViewAs;
#[test]
fn display() {
let view_as = ViewAs::Moderator;
assert_eq!(format!("{}", view_as), "moderator".to_string());
}
#[test]
fn debug() {
let view_as = ViewAs::Moderator;
assert_eq!(format!("{:?}", view_as), "moderator".to_string());
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug)]
struct CompositeType {
view_as: ViewAs,
string: String,
}
mod serde_serialization {
use crate::common::view_as::ViewAs;
use super::CompositeType;
#[test]
fn serialize() {
let expected = "\"author\"".to_string(); // NB: Quoted
assert_eq!(expected, toml::to_string(&ViewAs::Author).unwrap());
// Just to show this serializes the same as a string
assert_eq!(expected, toml::to_string("author").unwrap());
}
#[test]
fn nested_serialize() {
let value = CompositeType { view_as: ViewAs::Moderator, string: "bar".to_string() };
let expected = r#"{"view_as":"moderator","string":"bar"}"#.to_string();
assert_eq!(expected, serde_json::to_string(&value).unwrap());
}
}
mod serde_deserialization {
use crate::common::view_as::ViewAs;
use super::CompositeType;
#[test]
fn deserialize() {
let payload = "\"another_user\""; // NB: Quoted
let value: ViewAs = serde_json::from_str(payload).unwrap();
assert_eq!(value, ViewAs::AnotherUser);
}
#[test]
fn nested_deserialize() {
let payload = r#"{"view_as":"another_user","string":"bar"}"#.to_string();
let expected = CompositeType {
view_as: ViewAs::AnotherUser,
string: "bar".to_string(),
};
assert_eq!(expected, serde_json::from_str::<CompositeType>(&payload).unwrap());
}
}
}
+2 -1
View File
@@ -10,7 +10,8 @@
//!
// Never allow these
#![forbid(private_in_public)]
#![forbid(private_bounds)]
#![forbid(private_interfaces)]
#![forbid(unused_must_use)] // NB: It's unsafe to not close/check some things
// Okay to toggle
+2 -1
View File
@@ -1,5 +1,6 @@
// Never allow these
#![forbid(private_in_public)]
#![forbid(private_bounds)]
#![forbid(private_interfaces)]
#![forbid(unused_must_use)] // NB: It's unsafe to not close/check some things
// Okay to toggle
+2 -1
View File
@@ -18,7 +18,8 @@
//!
// Never allow these
#![forbid(private_in_public)]
#![forbid(private_bounds)]
#![forbid(private_interfaces)]
#![forbid(unused_must_use)] // NB: It's unsafe to not close/check some things
// Okay to toggle
+9 -1
View File
@@ -24,6 +24,7 @@ use strum::EnumIter;
pub(crate) enum TokenPrefix {
AnonymousVisitorTracking, // AVTs are not stored as primary keys in any table, but an index in many tables.
AuditLog,
BatchGeneration,
Comment,
DownloadJob,
EmailSenderJob,
@@ -90,6 +91,7 @@ impl PrefixGenerator for TokenPrefix {
match self {
Self::AnonymousVisitorTracking => "avt_",
Self::AuditLog => "audit_",
Self::BatchGeneration => "batch_g_",
Self::Comment => "comment_",
Self::DownloadJob => "jdown_", // NB: Previously "JGUP:"
Self::EmailSenderJob => "email_job_",
@@ -297,7 +299,13 @@ mod tests {
#[test]
fn test_all_prefixes_end_with_separator_length_one() {
for prefix in get_all_prefixes().iter().map(|s| *s) {
if prefix == "news_story_" || prefix == "tts_task_" || prefix == "INT_API:" || prefix == "pw_reset_" || prefix == "email_job_" {
if prefix == "news_story_"
|| prefix == "tts_task_"
|| prefix == "INT_API:"
|| prefix == "pw_reset_"
|| prefix == "email_job_"
|| prefix == "batch_g_"
{
// TODO/FIXME: I'm too tired at 5AM to replacen from the left. Make this test valid.
// These tokens are from the AIChatBot sidecar, so asserting their validity is less important.
continue;
@@ -0,0 +1,15 @@
use std::fmt::Debug;
use serde::Deserialize;
use serde::Serialize;
use utoipa::ToSchema;
use crate::prefixes::TokenPrefix;
/// The primary key for Audit Logs.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, sqlx::Type, Debug, Serialize, Deserialize, ToSchema)]
#[sqlx(transparent)]
pub struct BatchGenerationToken(pub String);
impl_string_token!(BatchGenerationToken);
impl_crockford_generator!(BatchGenerationToken, 32usize, TokenPrefix::BatchGeneration, CrockfordLower);
+2 -1
View File
@@ -2,6 +2,7 @@ pub mod anonymous_visitor_tracking;
pub mod api_tokens_external;
pub mod api_tokens_internal;
pub mod audit_logs;
pub mod batch_generations;
pub mod comments;
pub mod email_sender_job_token;
pub mod firehose_entries;
@@ -20,6 +21,7 @@ pub mod tts_results;
pub mod twitch_event_rule;
pub mod twitch_oauth_tokens_grouping;
pub mod twitch_oauth_tokens_internal;
pub mod user_bookmarks;
pub mod user_sessions;
pub mod user_subscriptions;
pub mod users;
@@ -34,4 +36,3 @@ pub mod w2l_templates;
pub mod zs_voice_dataset_samples;
pub mod zs_voice_datasets;
pub mod zs_voices;
pub mod user_bookmarks;
+7 -10
View File
@@ -8,12 +8,11 @@ use errors::AnyhowResult;
use crate::bucket_clients::get_bucket_clients;
use crate::cli_args::parse_cli_args;
use crate::seeding::model_weights::seed_weights; // V1
use crate::seeding::seed_model_weights::seed_weights_files; // V2 v3 will come later on when everything is more conslidated and clear.
use crate::seeding::seed_media_files::seed_media_files;
use crate::seeding::seed_model_weights::seed_weights_files; // V2 v3 will come later on when everything is more conslidated and clear.
use crate::seeding::tts_tacotron2::seed_tts_tacotron2;
use crate::seeding::users::seed_user_accounts;
use crate::seeding::voice_conversion::seed_voice_conversion;
use crate::seeding::zero_shot_tts::seed_zero_shot_tts;
pub mod bucket_clients;
@@ -47,19 +46,17 @@ pub async fn main() -> AnyhowResult<()> {
maybe_bucket_clients = Some(get_bucket_clients()?);
}
let mut maybe_elasticsearch = None;
if args.seed_elasticsearch {
maybe_elasticsearch = Some(get_elasticsearch_client());
}
// let mut maybe_elasticsearch = None;
//
// if args.seed_elasticsearch {
// maybe_elasticsearch = Some(get_elasticsearch_client());
// }
seed_user_accounts(&pool).await?;
seed_media_files(&pool, maybe_bucket_clients.as_ref()).await?;
seed_zero_shot_tts(&pool, maybe_bucket_clients.as_ref()).await?;
//seed_zero_shot_tts(&pool, maybe_bucket_clients.as_ref()).await?;
seed_voice_conversion(&pool).await?;
seed_weights(&pool).await?;
seed_tts_tacotron2(&pool, maybe_bucket_clients.as_ref()).await?;
// should seed the weights with a few files for hanashi
@@ -81,7 +81,7 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
*Thank you for your continued support and feedback!*
"#;
let sd1_5_image_token = "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/be706282-2978-42a0-aaa2-73881aad94e9/width=1024/00049-2287632957-1girl,face,curly%20hair,red%20hair,white%20background,.jpeg";
let _sd1_5_image_token = "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/be706282-2978-42a0-aaa2-73881aad94e9/width=1024/00049-2287632957-1girl,face,curly%20hair,red%20hair,white%20background,.jpeg";
// create a loop that loops from 1 to 100
for i in 1..=100 {
@@ -111,16 +111,15 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
let mut description_rendered_html;
let mut original_filename;
let mut original_download_url;
let mut thumbnail_token;
let mut private_bucket_hash:String = "".to_string();
let mut _private_bucket_hash:String = "".to_string();
let mut private_bucket_prefix;
let mut private_bucket_extension;
let mut cached_user_ratings_total_count;
let mut cached_user_ratings_positive_count;
let mut cached_user_ratings_negative_count;
let mut cached_user_ratings_ratio;
//let mut cached_user_ratings_total_count;
//let mut cached_user_ratings_positive_count;
//let mut cached_user_ratings_negative_count;
//let mut cached_user_ratings_ratio;
let mut version;
match i {
@@ -140,16 +139,13 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
original_filename = format!("gura_gwar{}.safetensors", i);
original_download_url = format!("www.google.ca");
// NOTE TO SELF this will be a join for later on for now they can use this.
thumbnail_token = "";
// private_bucket_hash = format!("bucket_hash{}", i);
private_bucket_prefix = format!("_fake");
private_bucket_extension = format!("rvcV2");
cached_user_ratings_total_count = i;
cached_user_ratings_positive_count = i;
cached_user_ratings_negative_count = i;
cached_user_ratings_ratio = i as u32 / 100;
//cached_user_ratings_total_count = i;
//cached_user_ratings_positive_count = i;
//cached_user_ratings_negative_count = i;
//cached_user_ratings_ratio = i as u32 / 100;
version = i as i32;
println!("Seeding RVCv2 model {}", i);
},
@@ -171,17 +167,14 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
original_filename = format!("filename{}.txt", i);
original_download_url = format!("https://civitai.com/api/download/models/149193?type=Model&format=SafeTensor&size=pruned&fp=fp16");
// NOTE TO SELF this will be a join for later on for now they can use this.
thumbnail_token = "";
// private_bucket_hash = format!("bucket_hash{}", i);
private_bucket_prefix = format!("_fake");
private_bucket_extension = format!("tt2");
cached_user_ratings_total_count = i;
cached_user_ratings_positive_count = i;
cached_user_ratings_negative_count = i;
cached_user_ratings_ratio = i as u32 / 100;
//cached_user_ratings_total_count = i;
//cached_user_ratings_positive_count = i;
//cached_user_ratings_negative_count = i;
//cached_user_ratings_ratio = i as u32 / 100;
version = i as i32;
println!("Seeding TT2 model {}", i);
},
@@ -197,17 +190,14 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
original_filename = format!("filename{}.txt", i);
original_download_url = format!("https://civitai.com/api/download/models/149193?type=Model&format=SafeTensor&size=pruned&fp=fp16");
// NOTE TO SELF this will be a join for later on for now they can use this.
thumbnail_token = ""; //sd1_5_image_token;
// private_bucket_hash = format!("bucket_hash{}", i);
private_bucket_prefix = format!("_fake");
private_bucket_extension = format!("sd15");
cached_user_ratings_total_count = i;
cached_user_ratings_positive_count = i;
cached_user_ratings_negative_count = i;
cached_user_ratings_ratio = i as u32 / 100;
//cached_user_ratings_total_count = i;
//cached_user_ratings_positive_count = i;
//cached_user_ratings_negative_count = i;
//cached_user_ratings_ratio = i as u32 / 100;
version = i as i32;
println!("Seeding SD15 model {}", i);
},
@@ -230,7 +220,7 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
Have fun! 😊
"#;
let sdxl_image_token = "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/be706282-2978-42a0-aaa2-73881aad94e9/width=1024/00049-2287632957-1girl,face,curly%20hair,red%20hair,white%20background,.jpeg";
let _sdxl_image_token = "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/be706282-2978-42a0-aaa2-73881aad94e9/width=1024/00049-2287632957-1girl,face,curly%20hair,red%20hair,white%20background,.jpeg";
model_weight_token = ModelWeightToken::generate_for_testing_and_dev_seeding_never_use_in_production_seriously();
title = format!("SDXL_Niji_Special Edition: {}", i);
@@ -245,13 +235,10 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
original_filename = format!("filename{}.txt", i);
original_download_url = format!("https://civitai.com/api/download/models/149193?type=Model&format=SafeTensor&size=pruned&fp=fp16");
// NOTE TO SELF this will be a join for later on for now they can use this.
thumbnail_token = "";
cached_user_ratings_total_count = i;
cached_user_ratings_positive_count = i;
cached_user_ratings_negative_count = i;
cached_user_ratings_ratio = i as u32 / 100;
//cached_user_ratings_total_count = i;
//cached_user_ratings_positive_count = i;
//cached_user_ratings_negative_count = i;
//cached_user_ratings_ratio = i as u32 / 100;
version = i as i32;
println!("Seeding SDXL model {}", i);
},
@@ -262,7 +249,7 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
- LoRA Gawr Gura
"#;
let lora_image_token = "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/123645df-dee2-4239-863a-76a150b09c32/width=1024/00000-2171948503.jpeg";
let _lora_image_token = "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/123645df-dee2-4239-863a-76a150b09c32/width=1024/00000-2171948503.jpeg";
model_weight_token = ModelWeightToken::generate_for_testing_and_dev_seeding_never_use_in_production_seriously();
title = format!("Gawr Gura LoRA: {}", i);
@@ -273,17 +260,14 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
original_filename = format!("filename{}.txt", i);
original_download_url = format!("https://civitai.com/api/download/models/149193?type=Model&format=SafeTensor&size=pruned&fp=fp16");
// NOTE TO SELF this will be a join for later on for now they can use this.
thumbnail_token = ""; // lora_image_token;
// private_bucket_hash = format!("bucket_hash{}", i);
private_bucket_prefix = format!("_fake");
private_bucket_extension = format!("loRA");
cached_user_ratings_total_count = i;
cached_user_ratings_positive_count = i;
cached_user_ratings_negative_count = i;
cached_user_ratings_ratio = i as u32 / 100;
//cached_user_ratings_total_count = i;
//cached_user_ratings_positive_count = i;
//cached_user_ratings_negative_count = i;
//cached_user_ratings_ratio = i as u32 / 100;
version = i as i32;
println!("Seeding LoRA model {}", i);
},
@@ -303,16 +287,13 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
original_filename = format!("gura_gwar{}.safetensors", i);
original_download_url = format!("www.google.ca");
// NOTE TO SELF this will be a join for later on for now they can use this.
thumbnail_token = "";
// private_bucket_hash = format!("bucket_hash{}", i);
private_bucket_prefix = format!("_fake");
private_bucket_extension = format!("rvcV2");
cached_user_ratings_total_count = i;
cached_user_ratings_positive_count = i;
cached_user_ratings_negative_count = i;
cached_user_ratings_ratio = i as u32 / 100;
//cached_user_ratings_total_count = i;
//cached_user_ratings_positive_count = i;
//cached_user_ratings_negative_count = i;
//cached_user_ratings_ratio = i as u32 / 100;
version = i as i32;
println!("Out of range");
@@ -324,9 +305,8 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
weights_type: weights_types, // replace with actual WeightsType
weights_category, // replace with actual WeightsCategory
title,
maybe_thumbnail_token: Some(thumbnail_token.to_string()),
description_markdown: description,
description_rendered_html: description_rendered_html.to_string(),
maybe_description_markdown: Some(description),
maybe_description_rendered_html: Some(description_rendered_html.to_string()),
creator_user_token: Some(&user_token), // replace with actual UserToken
creator_ip_address: "192.168.1.1",
creator_set_visibility: Visibility::Public,
@@ -338,10 +318,10 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
public_bucket_hash: "bucket_hash1".to_string(),
maybe_public_bucket_prefix: Some(private_bucket_prefix),
maybe_public_bucket_extension: Some(private_bucket_extension),
cached_user_ratings_total_count,
cached_user_ratings_positive_count,
cached_user_ratings_negative_count,
maybe_cached_user_ratings_ratio: Some(cached_user_ratings_ratio as f32),
//cached_user_ratings_total_count,
//cached_user_ratings_positive_count,
//cached_user_ratings_negative_count,
//maybe_cached_user_ratings_ratio: Some(cached_user_ratings_ratio as f32),
version,
mysql_pool: &mysql_pool, // replace with actual MySqlPool
};
@@ -370,9 +350,8 @@ pub async fn seed_weights_for_user_token(
weights_type: WeightsType::RvcV2, // replace with actual WeightsType
weights_category: WeightsCategory::VoiceConversion, // replace with actual WeightsCategory
title: "Title 1".to_string(),
maybe_thumbnail_token: Some("Thumbnail 1".to_string()),
description_markdown: "Description 1".to_string(),
description_rendered_html: "<p>Description 1</p>".to_string(),
maybe_description_markdown: Some("Description 1".to_string()),
maybe_description_rendered_html: Some("<p>Description 1</p>".to_string()),
creator_user_token: Some(&user_token), // replace with actual UserToken
creator_ip_address: "192.168.1.1",
creator_set_visibility: Visibility::Public,
@@ -384,10 +363,10 @@ pub async fn seed_weights_for_user_token(
public_bucket_hash: "bucket_hash1".to_string(),
maybe_public_bucket_prefix: Some("_fake".to_string()),
maybe_public_bucket_extension: Some("rvc".to_string()),
cached_user_ratings_total_count: 10,
cached_user_ratings_positive_count: 9,
cached_user_ratings_negative_count: 1,
maybe_cached_user_ratings_ratio: Some(0.9),
//cached_user_ratings_total_count: 10,
//cached_user_ratings_positive_count: 9,
//cached_user_ratings_negative_count: 1,
//maybe_cached_user_ratings_ratio: Some(0.9),
version: 1,
mysql_pool: &mysql_pool, // replace with actual MySqlPool
},
@@ -396,9 +375,8 @@ pub async fn seed_weights_for_user_token(
weights_type: WeightsType::HifiganTacotron2, // replace with actual WeightsType
weights_category: WeightsCategory::TextToSpeech, // replace with actual WeightsCategory
title: "Title 2".to_string(),
maybe_thumbnail_token: Some("Thumbnail 2".to_string()),
description_markdown: "Description 2".to_string(),
description_rendered_html: "<p>Description 2</p>".to_string(),
maybe_description_markdown: Some("Description 2".to_string()),
maybe_description_rendered_html: Some("<p>Description 2</p>".to_string()),
creator_user_token: Some(&user_token), // replace with actual UserToken
creator_ip_address: "292.268.2.2",
creator_set_visibility: Visibility::Public,
@@ -410,10 +388,10 @@ pub async fn seed_weights_for_user_token(
public_bucket_hash: "bucket_hash2".to_string(),
maybe_public_bucket_prefix: Some("_fake".to_string()),
maybe_public_bucket_extension: Some("tt2".to_string()),
cached_user_ratings_total_count: 20,
cached_user_ratings_positive_count: 9,
cached_user_ratings_negative_count: 2,
maybe_cached_user_ratings_ratio: Some(0.9),
//cached_user_ratings_total_count: 20,
//cached_user_ratings_positive_count: 9,
//cached_user_ratings_negative_count: 2,
//maybe_cached_user_ratings_ratio: Some(0.9),
version: 2,
mysql_pool: &mysql_pool, // replace with actual MySqlPool
},
@@ -422,9 +400,8 @@ pub async fn seed_weights_for_user_token(
weights_type: WeightsType::StableDiffusion15, // replace with actual WeightsType
weights_category: WeightsCategory::ImageGeneration, // replace with actual WeightsCategory
title: "Title 3".to_string(),
maybe_thumbnail_token: Some("Thumbnail 3".to_string()),
description_markdown: "Description 3".to_string(),
description_rendered_html: "<p>Description 3</p>".to_string(),
maybe_description_markdown: Some("Description 3".to_string()),
maybe_description_rendered_html: Some("<p>Description 3</p>".to_string()),
creator_user_token: Some(&user_token), // replace with actual UserToken
creator_ip_address: "392.368.3.3",
creator_set_visibility: Visibility::Public,
@@ -436,10 +413,10 @@ pub async fn seed_weights_for_user_token(
public_bucket_hash: "bucket_hash3".to_string(),
maybe_public_bucket_prefix: Some("_fake".to_string()),
maybe_public_bucket_extension: Some("safetensors".to_string()),
cached_user_ratings_total_count: 10,
cached_user_ratings_positive_count: 9,
cached_user_ratings_negative_count: 1,
maybe_cached_user_ratings_ratio: Some(0.9),
//cached_user_ratings_total_count: 10,
//cached_user_ratings_positive_count: 9,
//cached_user_ratings_negative_count: 1,
//maybe_cached_user_ratings_ratio: Some(0.9),
version: 1,
mysql_pool: &mysql_pool, // replace with actual MySqlPool
},
@@ -448,9 +425,8 @@ pub async fn seed_weights_for_user_token(
weights_type: WeightsType::LoRA, // replace with actual WeightsType
weights_category: WeightsCategory::ImageGeneration, // replace with actual WeightsCategory
title: "Title 4".to_string(),
maybe_thumbnail_token: Some("Thumbnail 4".to_string()),
description_markdown: "Description 4".to_string(),
description_rendered_html: "<p>Description 4</p>".to_string(),
maybe_description_markdown: Some("Description 4".to_string()),
maybe_description_rendered_html: Some("<p>Description 4</p>".to_string()),
creator_user_token: Some(&user_token), // replace with actual UserToken
creator_ip_address: "192.168.1.1",
creator_set_visibility: Visibility::Public,
@@ -462,10 +438,10 @@ pub async fn seed_weights_for_user_token(
public_bucket_hash: "bucket_hash4".to_string(),
maybe_public_bucket_prefix: Some("_fake".to_string()),
maybe_public_bucket_extension: Some("LoRA".to_string()),
cached_user_ratings_total_count: 10,
cached_user_ratings_positive_count: 9,
cached_user_ratings_negative_count: 1,
maybe_cached_user_ratings_ratio: Some(0.9),
//cached_user_ratings_total_count: 10,
//cached_user_ratings_positive_count: 9,
//cached_user_ratings_negative_count: 1,
//maybe_cached_user_ratings_ratio: Some(0.9),
version: 2,
mysql_pool: &mysql_pool, // replace with actual MySqlPool
},
@@ -474,9 +450,8 @@ pub async fn seed_weights_for_user_token(
weights_type: WeightsType::LoRA, // replace with actual WeightsType
weights_category: WeightsCategory::ImageGeneration, // replace with actual WeightsCategory
title: "Title 5".to_string(),
maybe_thumbnail_token: Some("Thumbnail 4".to_string()),
description_markdown: "Description 4".to_string(),
description_rendered_html: "<p>Description 4</p>".to_string(),
maybe_description_markdown: Some("Description 4".to_string()),
maybe_description_rendered_html: Some("<p>Description 4</p>".to_string()),
creator_user_token: Some(&user_token), // replace with actual UserToken
creator_ip_address: "192.168.1.1",
creator_set_visibility: Visibility::Public,
@@ -488,10 +463,10 @@ pub async fn seed_weights_for_user_token(
public_bucket_hash: "bucket_hash4".to_string(),
maybe_public_bucket_prefix: Some("_fake".to_string()),
maybe_public_bucket_extension: Some("LoRA".to_string()),
cached_user_ratings_total_count: 10,
cached_user_ratings_positive_count: 9,
cached_user_ratings_negative_count: 1,
maybe_cached_user_ratings_ratio: Some(0.9),
//cached_user_ratings_total_count: 10,
//cached_user_ratings_positive_count: 9,
//cached_user_ratings_negative_count: 1,
//maybe_cached_user_ratings_ratio: Some(0.9),
version: 2,
mysql_pool: &mysql_pool, // replace with actual MySqlPool
}
@@ -504,7 +479,7 @@ pub async fn seed_weights_for_user_token(
}
pub async fn original_seed_weights(mysql_pool: &Pool<MySql>,user_token: UserToken) -> AnyhowResult<()> {
pub async fn original_seed_weights(mysql_pool: &Pool<MySql>, _user_token: UserToken) -> AnyhowResult<()> {
let model_weight_token1 = ModelWeightToken::generate_for_testing_and_dev_seeding_never_use_in_production_seriously();
let creator_token1 = UserToken::generate_for_testing_and_dev_seeding_never_use_in_production_seriously();
@@ -526,9 +501,8 @@ pub async fn original_seed_weights(mysql_pool: &Pool<MySql>,user_token: UserToke
weights_type: WeightsType::RvcV2, // replace with actual WeightsType
weights_category: WeightsCategory::VoiceConversion, // replace with actual WeightsCategory
title: "Title 1".to_string(),
maybe_thumbnail_token: Some("Thumbnail 1".to_string()),
description_markdown: "Description 1".to_string(),
description_rendered_html: "<p>Description 1</p>".to_string(),
maybe_description_markdown: Some("Description 1".to_string()),
maybe_description_rendered_html: Some("<p>Description 1</p>".to_string()),
creator_user_token: Some(&creator_token1), // replace with actual UserToken
creator_ip_address: "192.168.1.1",
creator_set_visibility: Visibility::Public,
@@ -540,10 +514,10 @@ pub async fn original_seed_weights(mysql_pool: &Pool<MySql>,user_token: UserToke
public_bucket_hash: "bucket_hash1".to_string(),
maybe_public_bucket_prefix: Some("_fake".to_string()),
maybe_public_bucket_extension: Some("rvc".to_string()),
cached_user_ratings_total_count: 10,
cached_user_ratings_positive_count: 9,
cached_user_ratings_negative_count: 1,
maybe_cached_user_ratings_ratio: Some(0.9),
//cached_user_ratings_total_count: 10,
//cached_user_ratings_positive_count: 9,
//cached_user_ratings_negative_count: 1,
//maybe_cached_user_ratings_ratio: Some(0.9),
version: 1,
mysql_pool: &mysql_pool, // replace with actual MySqlPool
},
@@ -552,9 +526,8 @@ pub async fn original_seed_weights(mysql_pool: &Pool<MySql>,user_token: UserToke
weights_type: WeightsType::HifiganTacotron2, // replace with actual WeightsType
weights_category: WeightsCategory::TextToSpeech, // replace with actual WeightsCategory
title: "Title 2".to_string(),
maybe_thumbnail_token: Some("Thumbnail 2".to_string()),
description_markdown: "Description 2".to_string(),
description_rendered_html: "<p>Description 2</p>".to_string(),
maybe_description_markdown: Some("Description 2".to_string()),
maybe_description_rendered_html: Some("<p>Description 2</p>".to_string()),
creator_user_token: Some(&creator_token2), // replace with actual UserToken
creator_ip_address: "292.268.2.2",
creator_set_visibility: Visibility::Public,
@@ -566,10 +539,10 @@ pub async fn original_seed_weights(mysql_pool: &Pool<MySql>,user_token: UserToke
public_bucket_hash: "bucket_hash2".to_string(),
maybe_public_bucket_prefix: Some("_fake".to_string()),
maybe_public_bucket_extension: Some("tt2".to_string()),
cached_user_ratings_total_count: 20,
cached_user_ratings_positive_count: 9,
cached_user_ratings_negative_count: 2,
maybe_cached_user_ratings_ratio: Some(0.9),
//cached_user_ratings_total_count: 20,
//cached_user_ratings_positive_count: 9,
//cached_user_ratings_negative_count: 2,
//maybe_cached_user_ratings_ratio: Some(0.9),
version: 2,
mysql_pool: &mysql_pool, // replace with actual MySqlPool
},
@@ -578,9 +551,8 @@ pub async fn original_seed_weights(mysql_pool: &Pool<MySql>,user_token: UserToke
weights_type: WeightsType::StableDiffusion15, // replace with actual WeightsType
weights_category: WeightsCategory::ImageGeneration, // replace with actual WeightsCategory
title: "Title 3".to_string(),
maybe_thumbnail_token: Some("Thumbnail 3".to_string()),
description_markdown: "Description 3".to_string(),
description_rendered_html: "<p>Description 3</p>".to_string(),
maybe_description_markdown: Some("Description 3".to_string()),
maybe_description_rendered_html: Some("<p>Description 3</p>".to_string()),
creator_user_token: Some(&creator_token3), // replace with actual UserToken
creator_ip_address: "392.368.3.3",
creator_set_visibility: Visibility::Public,
@@ -592,10 +564,10 @@ pub async fn original_seed_weights(mysql_pool: &Pool<MySql>,user_token: UserToke
public_bucket_hash: "bucket_hash3".to_string(),
maybe_public_bucket_prefix: Some("_fake".to_string()),
maybe_public_bucket_extension: Some("safetensors".to_string()),
cached_user_ratings_total_count: 10,
cached_user_ratings_positive_count: 9,
cached_user_ratings_negative_count: 1,
maybe_cached_user_ratings_ratio: Some(0.9),
//cached_user_ratings_total_count: 10,
//cached_user_ratings_positive_count: 9,
//cached_user_ratings_negative_count: 1,
//maybe_cached_user_ratings_ratio: Some(0.9),
version: 1,
mysql_pool: &mysql_pool, // replace with actual MySqlPool
},
@@ -604,9 +576,8 @@ pub async fn original_seed_weights(mysql_pool: &Pool<MySql>,user_token: UserToke
weights_type: WeightsType::LoRA, // replace with actual WeightsType
weights_category: WeightsCategory::ImageGeneration, // replace with actual WeightsCategory
title: "Title 4".to_string(),
maybe_thumbnail_token: Some("Thumbnail 4".to_string()),
description_markdown: "Description 4".to_string(),
description_rendered_html: "<p>Description 4</p>".to_string(),
maybe_description_markdown: Some("Description 4".to_string()),
maybe_description_rendered_html: Some("<p>Description 4</p>".to_string()),
creator_user_token: Some(&creator_token4), // replace with actual UserToken
creator_ip_address: "192.168.1.1",
creator_set_visibility: Visibility::Public,
@@ -618,10 +589,10 @@ pub async fn original_seed_weights(mysql_pool: &Pool<MySql>,user_token: UserToke
public_bucket_hash: "bucket_hash4".to_string(),
maybe_public_bucket_prefix: Some("_fake".to_string()),
maybe_public_bucket_extension: Some("LoRA".to_string()),
cached_user_ratings_total_count: 10,
cached_user_ratings_positive_count: 9,
cached_user_ratings_negative_count: 1,
maybe_cached_user_ratings_ratio: Some(0.9),
//cached_user_ratings_total_count: 10,
//cached_user_ratings_positive_count: 9,
//cached_user_ratings_negative_count: 1,
//maybe_cached_user_ratings_ratio: Some(0.9),
version: 2,
mysql_pool: &mysql_pool, // replace with actual MySqlPool
},
@@ -630,9 +601,8 @@ pub async fn original_seed_weights(mysql_pool: &Pool<MySql>,user_token: UserToke
weights_type: WeightsType::LoRA, // replace with actual WeightsType
weights_category: WeightsCategory::ImageGeneration, // replace with actual WeightsCategory
title: "Title 5".to_string(),
maybe_thumbnail_token: Some("Thumbnail 5".to_string()),
description_markdown: "Description 5".to_string(),
description_rendered_html: "<p>Description 5</p>".to_string(),
maybe_description_markdown: Some("Description 5".to_string()),
maybe_description_rendered_html: Some("<p>Description 5</p>".to_string()),
creator_user_token: Some(&creator_token5), // replace with actual UserToken
creator_ip_address: "192.168.1.1",
creator_set_visibility: Visibility::Public,
@@ -644,10 +614,10 @@ pub async fn original_seed_weights(mysql_pool: &Pool<MySql>,user_token: UserToke
public_bucket_hash: "bucket_hash5".to_string(),
maybe_public_bucket_prefix: Some("_fake".to_string()),
maybe_public_bucket_extension: Some("LoRA".to_string()),
cached_user_ratings_total_count: 10,
cached_user_ratings_positive_count: 9,
cached_user_ratings_negative_count: 1,
maybe_cached_user_ratings_ratio: Some(0.9),
//cached_user_ratings_total_count: 10,
//cached_user_ratings_positive_count: 9,
//cached_user_ratings_negative_count: 1,
//maybe_cached_user_ratings_ratio: Some(0.9),
version: 2,
mysql_pool: &mysql_pool, // replace with actual MySqlPool
}

Some files were not shown because too many files have changed in this diff Show More