8000 Unforked diesel (finally) by briancorbin · Pull Request #3304 · mobilecoinfoundation/mobilecoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Unforked diesel (finally) #3304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,5 @@ schnorrkel-og = { git = "https://github.com/mobilecoinfoundation/schnorrkel.git"
# See: https://github.com/pyfisch/cbor/pull/198
serde_cbor = { git = "https://github.com/mobilecoinofficial/cbor", rev = "4c886a7c1d523aae1ec4aa7386f402cb2f4341b5" }

# Override diesel dependency with our fork, to statically link SQLite.
diesel = { git = "https://github.com/mobilecoinofficial/diesel", rev = "026f6379715d27c8be48396e5ca9059f4a263198" }

# Fix issues with recent nightlies, bump curve25519-dalek version
x25519-dalek = { git = "https://github.com/mobilecoinfoundation/x25519-dalek.git", rev = "4fbaa3343301c62cfdbc3023c9f485257e6b718a" }
10 changes: 3 additions & 7 deletions fog/sql_recovery_db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ mc-fog-types = { path = "../types" }

chrono = "0.4"
clap = { version = "4.1", features = ["derive", "env"] }
diesel = { version = "1.4", features = ["chrono", "postgres", "r2d2"] }
diesel-derive-enum = { version = "1", features = ["postgres"] }
diesel_migrations = { version = "1.4", features = ["postgres"] }
diesel = { version = "2.0.3", features = ["chrono", "postgres", "r2d2"] }
diesel-derive-enum = { version = "2.0.1", features = ["postgres"] }
diesel_migrations = { version = "2.0.0", features = ["postgres"] }
displaydoc = { version = "0.2", default-features = false }
prost = "0.11"
r2d2 = "0.8.10"
Expand All @@ -56,7 +56,3 @@ mc-util-test-helper = { path = "../../util/test-helper" }

pem = "2.0"
rand = "0.8"

[build-dependencies]
# clippy fails to run without this.
diesel = { version = "1.4.8", features = ["chrono", "postgres", "r2d2"] }
12 changes: 5 additions & 7 deletions fog/sql_recovery_db/src/bin/fog_sql_recovery_db_migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@
//! A helper utility for running migrations on a database configured via
//! DATABASE_URL.

#[macro_use]
extern crate diesel_migrations;

use diesel::{prelude::*, PgConnection};
use diesel_migrations::embed_migrations;
use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
use std::env;

embed_migrations!("migrations/");
const MIGRATIONS: EmbeddedMigrations = embed_migrations!("./migrations");

fn main() {
let database_url = env::var("DATABASE_URL").expect("Missing DATABASE_URL environment variable");

let conn = PgConnection::establish(&database_url)
let conn = &mut PgConnection::establish(&database_url)
.expect("fog-sql-recovery-db-migrations cannot connect to PG database");

embedded_migrations::run(&conn).expect("Failed running migrations");
conn.run_pending_migrations(MIGRATIONS)
.expect("Failed running migrations");

println!("Done migrating Fog recovery DB!");
}
Loading
0