mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-09 19:41:32 +00:00
migrations
This commit is contained in:
1 parent
d0ac20ed1c
commit
26d16876d4
1 file changed
+17
-1
+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(())
|
||||
|
||||
Reference in new issue
Block a user