Skip to content

Commit

Permalink
chore(auth): don't migrate pool (#1803)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaro00 authored Jun 14, 2024
1 parent 01f5dca commit 03406f0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
5 changes: 1 addition & 4 deletions auth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ use shuttle_backends::client::{
PermissionsDal,
};
use shuttle_common::{claims::AccountTier, ApiKey};
use sqlx::{migrate::Migrator, query, PgPool};
use sqlx::{query, PgPool};
use tracing::info;
pub use user::User;

use crate::api::serve;
pub use api::ApiBuilder;
pub use args::{Args, Commands, InitArgs};

pub static MIGRATIONS: Migrator = sqlx::migrate!("./migrations");

pub async fn start(pool: PgPool, args: StartArgs) {
let router = api::ApiBuilder::new()
.with_pg_pool(pool)
Expand Down Expand Up @@ -135,7 +133,6 @@ pub async fn init(pool: PgPool, args: InitArgs, tier: AccountTier) -> Result<()>
pub async fn pgpool_init(db_uri: &str) -> Result<PgPool> {
let opts = db_uri.parse()?;
let pool = PgPool::connect_with(opts).await?;
MIGRATIONS.run(&pool).await?;

Ok(pool)
}
3 changes: 0 additions & 3 deletions auth/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
use clap::Parser;
use shuttle_backends::trace::setup_tracing;
use shuttle_common::{claims::AccountTier, log::Backend};
use sqlx::migrate::Migrator;
use tracing::trace;

use shuttle_auth::{copy_environment, init, pgpool_init, start, sync, Args, Commands};

pub static MIGRATIONS: Migrator = sqlx::migrate!("./migrations");

#[tokio::main]
async fn main() {
setup_tracing(tracing_subscriber::registry(), Backend::Auth);
Expand Down

0 comments on commit 03406f0

Please sign in to comment.