aboutsummaryrefslogtreecommitdiff
path: root/src/bin/convert_null_guilds.rs
diff options
context:
space:
mode:
authorNathan Perry <np@nathanperry.dev>2024-08-16 21:14:30 -0400
committerNathan Perry <np@nathanperry.dev>2024-08-16 21:15:07 -0400
commitef056edf92b678265a4666e1f9405e3b0ce66a42 (patch)
treeb3766d47ae2898d2a46f108de4e2be0ede6c400b /src/bin/convert_null_guilds.rs
parentc5ce454319a7d54d3967c6ea7695543e943a37b2 (diff)
repo: overhaul for multitenancy
Diffstat (limited to 'src/bin/convert_null_guilds.rs')
-rw-r--r--src/bin/convert_null_guilds.rs29
1 files changed, 29 insertions, 0 deletions
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(())
+}