Implement crash-safe streaming worker runtime
This commit is contained in:
parent
16cba3c317
commit
cdeef3cc1a
1 changed files with 7448 additions and 194 deletions
|
|
@ -0,0 +1,19 @@
|
|||
ALTER TABLE result_inventory_members
|
||||
DROP CONSTRAINT result_inventory_members_attempt_id_fkey,
|
||||
ADD CONSTRAINT result_inventory_members_attempt_id_fkey
|
||||
FOREIGN KEY (attempt_id)
|
||||
REFERENCES result_inventories (attempt_id)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE CASCADE
|
||||
DEFERRABLE INITIALLY DEFERRED;
|
||||
|
||||
ALTER TABLE result_inventories
|
||||
ADD COLUMN staging_origin_attempt_id TEXT,
|
||||
ADD COLUMN target_prefix TEXT,
|
||||
ADD CONSTRAINT result_inventories_staging_binding_check CHECK (
|
||||
(staging_origin_attempt_id IS NULL) = (target_prefix IS NULL)
|
||||
);
|
||||
|
||||
UPDATE result_inventories
|
||||
SET staging_origin_attempt_id = attempt_id,
|
||||
target_prefix = '';
|
||||
Loading…
Reference in a new issue