From 6e831c8253727f12565fb29d938f7601106df240 Mon Sep 17 00:00:00 2001 From: jude Date: Thu, 11 May 2023 13:53:52 +0100 Subject: [PATCH] Add migration for threads. Add ability to load .env from wd --- migrations/20230511125236_reminder_threads.sql | 2 ++ src/main.rs | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 migrations/20230511125236_reminder_threads.sql diff --git a/migrations/20230511125236_reminder_threads.sql b/migrations/20230511125236_reminder_threads.sql new file mode 100644 index 0000000..6dadba8 --- /dev/null +++ b/migrations/20230511125236_reminder_threads.sql @@ -0,0 +1,2 @@ +-- Add migration script here +ALTER TABLE reminders ADD COLUMN `thread_id` BIGINT DEFAULT NULL; diff --git a/src/main.rs b/src/main.rs index 173e758..58455cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -90,6 +90,8 @@ async fn _main(tx: Sender<()>) -> Result<(), Box> { if Path::new("/etc/reminder-rs/config.env").exists() { dotenv::from_path("/etc/reminder-rs/config.env")?; + } else { + dotenv::from_path(".env")?; } let discord_token = env::var("DISCORD_TOKEN").expect("Missing DISCORD_TOKEN from environment");