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:
parent
85c8a01f4a
commit
ab95a69dc8
22 changed files with 154 additions and 321 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue