diff --git a/hammond-data/src/index_feed.rs b/hammond-data/src/index_feed.rs index 52b3283..7e46239 100644 --- a/hammond-data/src/index_feed.rs +++ b/hammond-data/src/index_feed.rs @@ -149,7 +149,7 @@ fn index_channel_items( Ok(()) } -// TODO: maybe refactor into an Iterator for lazy evaluation. +// Maybe this can be refactored into an Iterator for lazy evaluation. pub fn fetch_feeds( connection: Arc>, force: bool, diff --git a/hammond-data/src/lib.rs b/hammond-data/src/lib.rs index 8a633b4..da76500 100644 --- a/hammond-data/src/lib.rs +++ b/hammond-data/src/lib.rs @@ -66,24 +66,22 @@ lazy_static!{ }; } -// TODO: REFACTOR pub fn init() -> Result<()> { let conn = establish_connection(); - // embedded_migrations::run(&conn)?; - embedded_migrations::run_with_output(&conn, &mut std::io::stdout())?; + run_migration_on(&conn)?; Ok(()) } pub fn run_migration_on(connection: &SqliteConnection) -> Result<()> { info!("Running DB Migrations..."); + // embedded_migrations::run(&conn)?; embedded_migrations::run_with_output(connection, &mut std::io::stdout())?; Ok(()) } pub fn establish_connection() -> SqliteConnection { let database_url = DB_PATH.to_str().unwrap(); - // let database_url = &String::from(".random/foo.db"); SqliteConnection::establish(database_url) .expect(&format!("Error connecting to {}", database_url)) } diff --git a/hammond-data/src/models.rs b/hammond-data/src/models.rs index 8355128..cf43dc9 100644 --- a/hammond-data/src/models.rs +++ b/hammond-data/src/models.rs @@ -198,7 +198,6 @@ impl<'a> Source { } } -// TODO: Remove pub fields and add setters. #[derive(Insertable)] #[table_name = "source"] #[derive(Debug, Clone)]