From ef056edf92b678265a4666e1f9405e3b0ce66a42 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Fri, 16 Aug 2024 21:14:30 -0400 Subject: repo: overhaul for multitenancy --- src/bin/convert_null_guilds.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/bin/convert_null_guilds.rs (limited to 'src/bin/convert_null_guilds.rs') diff --git a/src/bin/convert_null_guilds.rs b/src/bin/convert_null_guilds.rs new file mode 100644 index 0000000..69f9267 --- /dev/null +++ b/src/bin/convert_null_guilds.rs @@ -0,0 +1,29 @@ +use clap::Parser; +use diesel_async::{ + scoped_futures::ScopedFutureExt, + AsyncConnection, + RunQueryDsl, +}; +use dotenv::dotenv; + +use thulani::db; + +#[derive(clap::Parser)] +struct Opts { + #[arg(short, long)] + guild: u64, +} + +#[tokio::main] +pub async fn main() -> anyhow::Result<()> { + thulani::log_setup::init(); + dotenv().ok(); + + let opts = Opts::parse(); + + let mut conn = db::manual_migrate::connection_no_migrate().await?; + + db::manual_migrate::set_default_guild(conn, opts.guild).await?; + + Ok(()) +} -- cgit v1.3.1