From ab39abb2bc8d94ee6dfbd74a4d1776f1775b32a3 Mon Sep 17 00:00:00 2001 From: Heiko Seeberger Date: Sat, 21 Oct 2023 15:11:11 +0200 Subject: [PATCH] fix[eventsourced-postgres]: seq_no init --- eventsourced-postgres/src/evt_log.rs | 2 +- justfile | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/eventsourced-postgres/src/evt_log.rs b/eventsourced-postgres/src/evt_log.rs index 039301b..9332811 100644 --- a/eventsourced-postgres/src/evt_log.rs +++ b/eventsourced-postgres/src/evt_log.rs @@ -270,7 +270,7 @@ impl EvtLog for PostgresEvtLog { let last_seq_no = self .cnn() .await? - .query_one("SELECT COALESCE(MAX(seq_no), 0) FROM evts", &[]) + .query_one("SELECT COALESCE(MAX(seq_no), 1) FROM evts", &[]) .await .map_err(Error::ExecuteQuery) .and_then(|row| { diff --git a/justfile b/justfile index 493975c..3ab403c 100644 --- a/justfile +++ b/justfile @@ -15,6 +15,9 @@ lint: test: cargo test --all-features +fix: + cargo fix --allow-dirty --allow-staged --all-features + doc: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features