1
0

Add more info to search route (#60)

* Add more info to search route:

* Run formatter
This commit is contained in:
Geometrically
2020-09-06 08:19:53 -07:00
committed by GitHub
parent 0dfa378e38
commit b99f45874f
6 changed files with 38 additions and 17 deletions

View File

@@ -1,8 +1,8 @@
use log::{info, debug};
use log::{debug, info};
use sqlx::migrate::{Migrate, MigrateDatabase, Migrator};
use sqlx::postgres::{PgPool, PgPoolOptions};
use sqlx::migrate::{Migrator, Migrate, MigrateDatabase};
use sqlx::{Connection, PgConnection, Postgres};
use std::path::Path;
use sqlx::{PgConnection, Connection, Postgres};
const MIGRATION_FOLDER: &'static str = "migrations";
@@ -29,10 +29,9 @@ pub async fn check_for_migrations() -> Result<(), sqlx::Error> {
Ok(())
}
pub async fn run_migrations(uri: &str) -> Result<(), sqlx::Error> {
let migrator = Migrator::new(Path::new(MIGRATION_FOLDER)).await?;
let mut conn : PgConnection = PgConnection::connect(uri).await?;
let mut conn: PgConnection = PgConnection::connect(uri).await?;
conn.ensure_migrations_table().await?;
@@ -51,4 +50,4 @@ pub async fn run_migrations(uri: &str) -> Result<(), sqlx::Error> {
}
Ok(())
}
}