17 lines · 650 B · Text
RawDownload
-- Add migration script here ALTER TABLE buffers ADD COLUMN latest_operation_epoch INTEGER;ALTER TABLE buffers ADD COLUMN latest_operation_lamport_timestamp INTEGER;ALTER TABLE buffers ADD COLUMN latest_operation_replica_id INTEGER; WITH ops AS (    SELECT DISTINCT ON (buffer_id) buffer_id, epoch, lamport_timestamp, replica_id    FROM buffer_operations    ORDER BY buffer_id, epoch DESC, lamport_timestamp DESC, replica_id DESC)UPDATE buffersSET latest_operation_epoch = ops.epoch,    latest_operation_lamport_timestamp = ops.lamport_timestamp,    latest_operation_replica_id = ops.replica_idFROM opsWHERE buffers.id = ops.buffer_id;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t