Add migration for threads. Add ability to load .env from wd

This commit is contained in:
jude 2023-05-11 13:53:52 +01:00
parent 4416e5d175
commit 6e831c8253
2 changed files with 4 additions and 0 deletions

View File

@ -0,0 +1,2 @@
-- Add migration script here
ALTER TABLE reminders ADD COLUMN `thread_id` BIGINT DEFAULT NULL;

View File

@ -90,6 +90,8 @@ async fn _main(tx: Sender<()>) -> Result<(), Box<dyn StdError + Send + Sync>> {
if Path::new("/etc/reminder-rs/config.env").exists() { if Path::new("/etc/reminder-rs/config.env").exists() {
dotenv::from_path("/etc/reminder-rs/config.env")?; 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"); let discord_token = env::var("DISCORD_TOKEN").expect("Missing DISCORD_TOKEN from environment");