Skip to content

Commit b8e1598

Browse files
authored
fix(migrations): append_to_store was not using id columns in UPDATE (#91)
1 parent 87b767e commit b8e1598

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

eventually-postgres/src/migrations/V3__append_to_store.sql

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,10 @@ BEGIN
5050
END LOOP;
5151

5252
-- Update the aggregate with the latest version computed.
53-
UPDATE aggregates
54-
set "version" = aggregate_version
55-
WHERE aggregate_id = aggregate_id;
53+
UPDATE aggregates SET "version" = aggregate_version WHERE id = aggregate_id;
5654

5755
-- Update the global offset with the latest sequence number.
58-
UPDATE aggregate_types
59-
SET "offset" = sequence_number
60-
WHERE aggregate_type_id = aggregate_type_id;
56+
UPDATE aggregate_types SET "offset" = sequence_number WHERE id = aggregate_type_id;
6157

6258
RETURN QUERY
6359
SELECT aggregate_version, sequence_number;

0 commit comments

Comments
 (0)