summaryrefslogtreecommitdiff
path: root/server/src/main.rs
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2022-11-15 14:14:02 -0500
committerKjetil Orbekk <kj@orbekk.com>2022-11-15 14:14:02 -0500
commit8fa1b37bb705371bf5dee574f1f136019d3db9d1 (patch)
treeaabc46d6727a395f93badef0011ee165ab2cf6f0 /server/src/main.rs
parent6296e97fafd4bb5063541bee83061c398f31d19e (diff)
Implement DbJournal
Diffstat (limited to 'server/src/main.rs')
-rw-r--r--server/src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/src/main.rs b/server/src/main.rs
index 9b5adb7..6056dcd 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -1,4 +1,5 @@
use std::{collections::HashMap, env, str::FromStr, sync::Arc};
+use serde_json::json;
use uuid::Uuid;
use auth::AuthenticatedSession;
@@ -18,7 +19,7 @@ mod auth;
mod error;
mod server;
mod play;
-use crate::error::BridgeError;
+use crate::{error::BridgeError, play::{DbJournal, Journal}};
use crate::{
auth::{Authenticator, SessionId},
server::ServerContext,
@@ -44,6 +45,9 @@ async fn main() {
.await
.expect("db connection");
+ let mut jnl = DbJournal::new(db_pool.clone(), Uuid::new_v4());
+ jnl.append(0, json!("starting server")).await.expect("new object");
+
info!("Running db migrations");
sqlx::migrate!().run(&db_pool).await.expect("db migration");