-- Only needed if you already ran sql/migration_002_live_collab.sql
-- BEFORE this file existed (it's now included directly in that
-- migration and in schema.sql for anyone installing fresh). Adds
-- offline-tolerance to live "Edit online" sessions: a client_op_id on
-- each op lets a queued/retried edit (made while offline, then
-- resent once back online) be replayed safely without double-applying
-- it. Run once via phpMyAdmin → SQL tab, or:
--   mysql -u user -p dbname < sql/migration_003_offline_live_edits.sql

ALTER TABLE live_ops
    ADD COLUMN client_op_id VARCHAR(64) NULL AFTER payload,
    ADD UNIQUE KEY uniq_doc_clientop (document_id, client_op_id);
