You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But this relation will exist upon running the very first migration command?
How am I supposed to get my binary to migrate the Db upon further migrations?
Relevant code:
use sqlx::{migrate,PgPool};use tracing::instrument;#[instrument(name = "Migrating database", skip(pool))]pubasyncfnmigrate_db(pool:&PgPool){migrate!().run(pool).await.expect("DB Migration failed");}
I have added a build.rs as well
// generated by `sqlx migrate build-script`fnmain(){// trigger recompilation when a new migration is addedprintln!("cargo:rerun-if-changed=migrations");}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am a bit confused how I get sqlx
migrate!
to work when I have added a new migration script.It seems to be checking for the presence of relation "_sqlx_migrations"
Hence the following alert message
But this relation will exist upon running the very first migration command?
How am I supposed to get my binary to migrate the Db upon further migrations?
Relevant code:
I have added a
build.rs
as wellBeta Was this translation helpful? Give feedback.
All reactions