From a62f893a981bfdd57431e9be21628f3a7cfcc212 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Tue, 17 Sep 2024 23:57:46 +0100 Subject: [PATCH] fix: add logging and a default value for not null sql --- db/migrations/5_welcome-message.sql | 4 ++-- src/main.rs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/db/migrations/5_welcome-message.sql b/db/migrations/5_welcome-message.sql index 15a139c..c81289d 100644 --- a/db/migrations/5_welcome-message.sql +++ b/db/migrations/5_welcome-message.sql @@ -1,5 +1,5 @@ -- temp table to allow folks to verify by committee email. -- delete the col in teh server table ALTER TABLE servers ADD COLUMN bot_channel_id integer DEFAULT 0; -ALTER TABLE servers ADD COLUMN server_name text NOT NULL; -ALTER TABLE servers ADD COLUMN wolves_link text NOT NULL; \ No newline at end of file +ALTER TABLE servers ADD COLUMN server_name text NOT NULL DEFAULT ""; +ALTER TABLE servers ADD COLUMN wolves_link text NOT NULL DEFAULT ""; \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 316f31e..929d54e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -136,7 +136,10 @@ async fn main() { let config = get_config(); let db = match db_init(&config).await { Ok(x) => x, - Err(_) => return, + Err(err) => { + dbg!(err); + return + }, }; // Intents are a bitflag, bitwise operations can be used to dictate which intents to use