Use SQLx migrations

This commit is contained in:
jude
2023-03-24 11:11:51 +00:00
parent d70fb24eb1
commit 3ef8584189
10 changed files with 41 additions and 53 deletions

View File

@ -168,6 +168,8 @@ async fn _main(tx: Sender<()>) -> Result<(), Box<dyn StdError + Send + Sync>> {
let database =
Pool::connect(&env::var("DATABASE_URL").expect("No database URL provided")).await.unwrap();
sqlx::migrate!().run(&database).await?;
let popular_timezones = sqlx::query!(
"SELECT IFNULL(timezone, 'UTC') AS timezone
FROM users