-- Memorial: publication state + permanent payment

ALTER TABLE memorials
  ADD COLUMN published_at DATETIME NULL AFTER storage_used_bytes,
  ADD COLUMN paid_at DATETIME NULL AFTER published_at,
  ADD COLUMN expires_at DATETIME NULL AFTER paid_at;

CREATE INDEX idx_memorials_public_state ON memorials (visibility, published_at, paid_at, expires_at, deleted_at);

