Move migrations around
This commit is contained in:
parent
d5583e86bc
commit
e419923939
5 changed files with 3 additions and 2 deletions
1
.env
Normal file
1
.env
Normal file
|
@ -0,0 +1 @@
|
||||||
|
DATABASE_URL="sqlite://emgauwa-dev.sqlite"
|
|
@ -1,4 +1,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("cargo:rerun-if-changed=migrations");
|
println!("cargo:rerun-if-changed=migrations");
|
||||||
println!("cargo:rustc-env=DATABASE_URL=sqlite://emgauwa-dev.sqlite")
|
println!("cargo:rustc-env=DATABASE_URL=sqlite://emgauwa-dev.sqlite");
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ pub(crate) mod schedules;
|
||||||
pub(crate) mod tag;
|
pub(crate) mod tag;
|
||||||
pub mod types;
|
pub mod types;
|
||||||
|
|
||||||
static MIGRATOR: Migrator = sqlx::migrate!(); // defaults to "./migrations"
|
static MIGRATOR: Migrator = sqlx::migrate!("../migrations"); // defaults to "./migrations"
|
||||||
|
|
||||||
pub async fn run_migrations(pool: &Pool<Sqlite>) {
|
pub async fn run_migrations(pool: &Pool<Sqlite>) {
|
||||||
info!("Running migrations");
|
info!("Running migrations");
|
||||||
|
|
Loading…
Reference in a new issue