fixup audio improperly categorized

This commit is contained in:
Brandon Thomas committed 2024-05-01 01:27:52 -04:00
1 parent a4d620621b
commit 2a8af9dbf8
1 file changed
+23 -1
@@ -31,7 +31,7 @@ pub async fn migrate_media_files_enum_values(_args: &Args, mysql: &Pool<MySql>)
"#.to_string(),
};
let query_pair = QueryPair {
let _query_pair = QueryPair {
count_query: r#"
select count(*) as record_count
from media_files
@@ -47,6 +47,28 @@ pub async fn migrate_media_files_enum_values(_args: &Args, mysql: &Pool<MySql>)
"#.to_string(),
};
// +--------------+
// | record_count |
// +--------------+
// | 20570300 |
// +--------------+
// 1 row in set (42.86 sec)
let query_pair = QueryPair {
count_query: r#"
select count(*) as record_count
from media_files
where media_class = "unknown"
and media_type = "audio"
"#.to_string(),
migrate_query: r#"
update media_files
set media_class = "audio"
where media_class = "unknown"
and media_type = "audio"
limit 50000
"#.to_string(),
};
query_pair.run_migration(mysql).await?;
Ok(())