Run plume_models::migrate_data() on initialization

This commit is contained in:
Kitaiti Makoto 2021-09-11 23:06:49 +09:00
parent 2fcb449ed8
commit b41e982daf

View File

@ -15,6 +15,7 @@ use diesel::r2d2::ConnectionManager;
use plume_models::{ use plume_models::{
db_conn::{DbPool, PragmaForeignKey}, db_conn::{DbPool, PragmaForeignKey},
instance::Instance, instance::Instance,
migrate_data,
migrations::IMPORTED_MIGRATIONS, migrations::IMPORTED_MIGRATIONS,
remote_fetch_actor::RemoteFetchActor, remote_fetch_actor::RemoteFetchActor,
search::{actor::SearchActor, Searcher as UnmanagedSearcher}, search::{actor::SearchActor, Searcher as UnmanagedSearcher},
@ -79,6 +80,7 @@ Then try to restart Plume.
"# "#
) )
} }
migrate_data(&dbpool).expect("Failed to migrate data");
let workpool = ScheduledThreadPool::with_name("worker {}", num_cpus::get()); let workpool = ScheduledThreadPool::with_name("worker {}", num_cpus::get());
// we want a fast exit here, so // we want a fast exit here, so
let searcher = Arc::new(UnmanagedSearcher::open_or_recreate( let searcher = Arc::new(UnmanagedSearcher::open_or_recreate(