mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-31 15:37:49 +00:00
codegen db, misc
This commit is contained in:
1 parent
65028539c6
commit
5ee766d4e1
7 files changed
+101
-1
No files matched your search
+25
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n COUNT(*) as record_count\n FROM media_files as f\n left outer join model_weights as w\n on f.maybe_origin_model_token = w.token\n left outer join model_weights as w_old\n on f.maybe_origin_model_token = w_old.maybe_migration_old_model_token\n WHERE (w.token = ? OR w_old.token = ?)\n AND f.created_at >= ?\n AND f.created_at < ? + INTERVAL 1 DAY\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "record_count",
|
||||
"type_info": {
|
||||
"type": "LongLong",
|
||||
"flags": "NOT_NULL | BINARY",
|
||||
"char_set": 63,
|
||||
"max_size": 21
|
||||
}
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "3bbfaf131b5228c10320e915f553f845142920b16dc7d36f8640481760405d96"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nINSERT INTO model_weight_usage_counts\nSET\n token = ?,\n on_date = ?,\n usage_count = ?\n\n\nON DUPLICATE KEY UPDATE\n usage_count = ?\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "99e69537a33dd54d4c4433f24863e1749f544152578d503fc86d0503a425ae8d"
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\n SELECT\n token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n created_at,\n updated_at\n FROM model_weights\n WHERE\n updated_at > ?\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": "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": 2,
|
||||
"name": "created_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
"flags": "NOT_NULL | BINARY | TIMESTAMP",
|
||||
"char_set": 63,
|
||||
"max_size": 19
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "updated_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | TIMESTAMP | ON_UPDATE_NOW",
|
||||
"char_set": 63,
|
||||
"max_size": 19
|
||||
}
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "f68d01ee1339c0a1ea8301fcc74359e981c20abebd7024844bea6e1b9486b458"
|
||||
}
|
||||
File renamed without changes.
+5
@@ -2,6 +2,11 @@
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
-- Get pending job count
|
||||
select count(*)
|
||||
from generic_inference_jobs
|
||||
where status = 'pending';
|
||||
|
||||
-- Kill *ALL* pending / outstanding jobs of any type
|
||||
update generic_inference_jobs
|
||||
set status = 'dead'
|
||||
File renamed without changes.
+1
-1
@@ -45,7 +45,7 @@ pub async fn run_migration(mysql: Pool<MySql>) -> AnyhowResult<()> {
|
||||
|
||||
const THREAD_COUNT : usize = 8;
|
||||
let chunk_size = models.len() / THREAD_COUNT;
|
||||
|
||||
|
||||
let model_chunks = split_vec(models, chunk_size);
|
||||
let mut join_handles = Vec::with_capacity(model_chunks.len());
|
||||
|
||||
|
||||
Reference in new issue
Block a user