summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index ec0e660..13e4cd2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -3,6 +3,8 @@ extern crate fern;
#[macro_use]
extern crate log;
extern crate clap;
+#[macro_use]
+extern crate diesel_migrations;
use chrono::Utc;
use clap::App;
@@ -15,6 +17,8 @@ use pjournal::importer;
use pjournal::models;
use serde_json::to_value;
+embed_migrations!();
+
fn setup_logger() -> Result<(), fern::InitError> {
use fern::colors::{Color, ColoredLevelConfig};
let colors = ColoredLevelConfig::new();
@@ -140,6 +144,8 @@ fn main() {
let db_url = matches.value_of("database_url").unwrap();
let conn = PgConnection::establish(db_url).unwrap();
+ embedded_migrations::run(&conn).unwrap();
+
if let Some(matches) = matches.subcommand_matches("init") {
let config = models::Config {
strava_client_id: matches.value_of("strava_client_id").unwrap().to_string(),