migrations

This commit is contained in:
Brandon Thomas committed 2024-05-01 18:16:29 -04:00
1 parent d0ac20ed1c
commit 26d16876d4
1 file changed
+17 -1
@@ -53,7 +53,7 @@ pub async fn migrate_media_files_enum_values(_args: &Args, mysql: &Pool<MySql>)
// | 20570300 |
// +--------------+
// 1 row in set (42.86 sec)
let query_pair = QueryPair {
let _query_pair = QueryPair {
count_query: r#"
select count(*) as record_count
from media_files
@@ -69,6 +69,22 @@ pub async fn migrate_media_files_enum_values(_args: &Args, mysql: &Pool<MySql>)
"#.to_string(),
};
let query_pair = QueryPair {
count_query: r#"
select count(*) as record_count
from media_files
where media_class = "unknown"
and media_type = "video"
"#.to_string(),
migrate_query: r#"
update media_files
set media_class = "video"
where media_class = "unknown"
and media_type = "video"
limit 100000
"#.to_string(),
};
query_pair.run_migration(mysql).await?;
Ok(())