From 69bc40d3dbdd5a4fdbcf2a56da1f7ff96b6ee8d3 Mon Sep 17 00:00:00 2001 From: Andrew Huynh Date: Sat, 19 Nov 2022 09:39:20 -0800 Subject: [PATCH] add a tweak to local_file_pathfix migration to get around `Queued` enum issue --- .../src/m20221115_000001_local_file_pathfix.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/migrations/src/m20221115_000001_local_file_pathfix.rs b/crates/migrations/src/m20221115_000001_local_file_pathfix.rs index e74368701..e434215c4 100644 --- a/crates/migrations/src/m20221115_000001_local_file_pathfix.rs +++ b/crates/migrations/src/m20221115_000001_local_file_pathfix.rs @@ -1,5 +1,7 @@ +use crate::sea_orm::Statement; use entities::schema::{DocFields, SearchDocument}; use sea_orm_migration::prelude::*; +use sea_orm_migration::sea_orm::ConnectionTrait; use entities::models::{crawl_queue, indexed_document}; use entities::sea_orm::{ActiveModelTrait, ColumnTrait, EntityTrait, QueryFilter, Set}; @@ -126,6 +128,15 @@ impl MigrationTrait for Migration { let db = manager.get_connection(); println!("Updating crawl_queue"); + manager + .get_connection() + .execute(Statement::from_string( + manager.get_database_backend(), + "UPDATE crawl_queue SET status = 'Queued' where status = '''Queued''ru'" + .to_string(), + )) + .await?; + let queued = crawl_queue::Entity::find() .filter(crawl_queue::Column::Url.starts_with("file://")) .all(db)