Skip to content

Commit

Permalink
fixing migration not running bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolai Schimke authored and Nikolai Schimke committed Feb 3, 2024
1 parent c982d69 commit fedc662
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/bin/sportshub.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

use clap::{Parser, Subcommand};


use scraper::{db, scrape, web_server_routes};
use scraper::{
db::{self, helpers::run_migrations},
scrape,
web_server_routes,
};


#[derive(Parser)]
Expand Down Expand Up @@ -77,6 +78,7 @@ enum DataCommands {
async fn main() {
let mut conn = db::helpers::establish_connection().unwrap();

run_migrations(&mut db::helpers::establish_connection().unwrap(), &mut conn).unwrap();

let cli = Cli::parse();

Expand Down
2 changes: 1 addition & 1 deletion src/db/helpers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Database operation helpers for sqlite, using diesel
use std::time::{Duration};
use std::time::Duration;

use anyhow::Error;
use diesel::{prelude::*, sqlite::Sqlite, RunQueryDsl};
Expand Down

0 comments on commit fedc662

Please sign in to comment.