Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(auth): don't migrate pool #1803

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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