0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2025-03-05 10:10:24 +01:00

Use the previous MAX value if any to set the stream_id

This commit is contained in:
Mark Haines 2016-09-09 11:52:44 +01:00
parent 6a6cbfcf1e
commit 647c724573

View file

@ -17,4 +17,5 @@ CREATE TABLE device_max_stream_id (
stream_id BIGINT NOT NULL
);
INSERT INTO device_max_stream_id (stream_id) VALUES (0);
INSERT INTO device_max_stream_id (stream_id)
SELECT COALESCE(MAX(stream_id), 0) FROM device_inbox;