File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/packages/emmett-postgresql/src/eventStore/schema Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,10 @@ export const appendToStreamSQL = rawSql(
48
48
v_transaction_id := pg_current_xact_id();
49
49
50
50
IF v_expected_stream_position IS NULL THEN
51
- SELECT COALESCE(max( stream_position) , 0) INTO v_expected_stream_position
51
+ SELECT COALESCE(stream_position, 0) INTO v_expected_stream_position
52
52
FROM ${ streamsTable . name }
53
- WHERE stream_id = v_stream_id AND partition = v_partition;
54
- END IF;
53
+ WHERE stream_id = v_stream_id AND partition = v_partition AND is_archived = FALSE ;
54
+ END IF;
55
55
56
56
v_next_stream_position := v_expected_stream_position + array_upper(v_messages_data, 1);
57
57
@@ -76,7 +76,7 @@ export const appendToStreamSQL = rawSql(
76
76
WITH ev AS (
77
77
SELECT row_number() OVER () + v_expected_stream_position AS stream_position,
78
78
message_data,
79
- message_metadata ,
79
+ messAage_metadata ,
80
80
schema_version,
81
81
message_id,
82
82
message_type,
You can’t perform that action at this time.
0 commit comments