fix(setup): update chunks in step 11 (#5965)

This commit is contained in:
Silvan
2023-06-02 09:31:18 +00:00
committed by GitHub
parent c8b0e5a6c5
commit ebca7b6e3d
6 changed files with 76 additions and 16 deletions
+6
View File
@@ -0,0 +1,6 @@
BEGIN;
-- create table with empty created_at
ALTER TABLE eventstore.events ADD COLUMN IF NOT EXISTS created_at TIMESTAMPTZ DEFAULT NULL;
-- set column rules
ALTER TABLE eventstore.events ALTER COLUMN created_at SET DEFAULT clock_timestamp();
COMMIT;
+1
View File
@@ -0,0 +1 @@
SELECT id, creation_date FROM eventstore.events WHERE created_at IS NULL ORDER BY event_sequence DESC, instance_id LIMIT 20 FOR UPDATE
+1
View File
@@ -0,0 +1 @@
UPDATE eventstore.events SET created_at = $1 WHERE id = $2
+3
View File
@@ -0,0 +1,3 @@
BEGIN;
ALTER TABLE eventstore.events ALTER COLUMN created_at SET NOT NULL;
COMMIT;