Move migrations around

This commit is contained in:
Tobias Reisinger 2023-11-23 03:35:40 +01:00
parent d5583e86bc
commit e419923939
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
5 changed files with 3 additions and 2 deletions

1
.env Normal file
View file

@ -0,0 +1 @@
DATABASE_URL="sqlite://emgauwa-dev.sqlite"

View file

@ -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");
} }

View file

@ -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");