-
I'm running my backend using Supabase. This handles migrations for me, and generates a
I'm accessing the DB from Rust using SQLx, and that's working brilliantly. Now I want to test my business logic around the queries, so I'm trying to get #[cfg(test)]
mod tests {
use super::*;
static TEST_DATA_DIR: &str = "tests/data";
#[sqlx::test(migrations = "../backend/supabase/migrations")]
async fn test_assert(pool: PgPool) {
assert_eq!(0, 1);
}
} I have resolved the superuser issue, but now I am getting a different error:
The first line of my first sql migration file is this: create extension if not exists "postgis" with schema "extensions"; So presumably this is the problem… How can I get around this? To be clear, this migration works fine when I run it via Supabase. The DB does have access to the To be clear, I've never run Update: That is definitely the problem, because when I remove that line from the sql file, the migration fails at a different place. (The first time the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I have been able to get around this error by adding this line before the create schema if not exists "extensions"; Because Supabase creates databases with an "extensions" schema already, this new command is a no-op for |
Beta Was this translation helpful? Give feedback.
I have been able to get around this error by adding this line before the
create extension
command:Because Supabase creates databases with an "extensions" schema already, this new command is a no-op for
supabase db diff
, but gets around thesqlx
error.