mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 03:11:32 +00:00
Revert "always use embedded migrations"
This reverts commit ca34b9a9bd
.
This commit is contained in:
parent
ca34b9a9bd
commit
92d31616a9
1 changed files with 12 additions and 0 deletions
|
@ -27,12 +27,24 @@ diesel::table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In production, include migrations in the binary
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
fn migrations() -> diesel_migrations::EmbeddedMigrations {
|
fn migrations() -> diesel_migrations::EmbeddedMigrations {
|
||||||
// Using `const` here is required by the borrow checker
|
// Using `const` here is required by the borrow checker
|
||||||
const MIGRATIONS: diesel_migrations::EmbeddedMigrations = diesel_migrations::embed_migrations!();
|
const MIGRATIONS: diesel_migrations::EmbeddedMigrations = diesel_migrations::embed_migrations!();
|
||||||
MIGRATIONS
|
MIGRATIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avoid recompiling when migrations are changed
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
#[expect(clippy::expect_used)]
|
||||||
|
fn migrations() -> diesel_migrations::FileBasedMigrations {
|
||||||
|
diesel_migrations::FileBasedMigrations::find_migrations_directory_in_path(env!(
|
||||||
|
"CARGO_MANIFEST_DIR"
|
||||||
|
))
|
||||||
|
.expect("failed to get migration source")
|
||||||
|
}
|
||||||
|
|
||||||
/// This SQL code sets up the `r` schema, which contains things that can be safely dropped and
|
/// This SQL code sets up the `r` schema, which contains things that can be safely dropped and
|
||||||
/// replaced instead of being changed using migrations. It may not create or modify things outside
|
/// replaced instead of being changed using migrations. It may not create or modify things outside
|
||||||
/// of the `r` schema (indicated by `r.` before the name), unless a comment says otherwise.
|
/// of the `r` schema (indicated by `r.` before the name), unless a comment says otherwise.
|
||||||
|
|
Loading…
Reference in a new issue