1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-06-15 23:30:07 +00:00

Rework migrations for MySQL

This commit is contained in:
Emil Madsen 2019-05-20 21:12:41 +02:00
parent 85c8a01f4a
commit ab95a69dc8
22 changed files with 154 additions and 321 deletions

View file

@ -2,7 +2,7 @@ use std::ops::Deref;
use diesel::r2d2;
use diesel::r2d2::ConnectionManager;
use diesel::sqlite::MysqlConnection;
use diesel::mysql::MysqlConnection;
use diesel::{Connection as DieselConnection, ConnectionError};
use rocket::http::Status;
@ -31,7 +31,9 @@ pub fn init_pool() -> Pool {
}
pub fn get_connection() -> Result<Connection, ConnectionError> {
Connection::establish(&CONFIG.database_url())
let url = CONFIG.database_url();
println!("{}", url.to_string());
Connection::establish(&url)
}
/// Attempts to retrieve a single connection from the managed database pool. If