V195: image editing.
An edited image keeps its uuid — every module that stored it keeps
pointing at it — and its original instance becomes the edited bytes. The
unedited original moves to a hidden, system-managed child file, so the
owner can restore or delete it but nobody else can reach it. These columns
record that on phoenix_kit_files:
edits(jsonb) — the current edit (PhoenixKit.Modules.Storage.ImageEdit), always applied to the unedited originaledit_revision(integer, default 0) — bumped by every save and revert, so a job can tell whether its snapshot is still the one wantededit_state(varchar(16)) — nil, "pending" or "failed"; while it is set the file is served as a placeholder, never as the old bytesoriginal_file_uuid— on an edited file, its hidden unedited backupedited_from_uuid— on a "save as copy" result, the file it came from
Both references are ON DELETE SET NULL: the backup's own lifecycle
follows parent_file_uuid (cascade), and a copy outlives its source.
It also indexes phoenix_kit_file_instances.file_name: a stored object is
now deleted only when no instance row still references its key, and that
check runs on every deletion.
Additive only; re-runnable.
Summary
Functions
Rolls V195 back: drops the columns and the index. Edits are lost; files keep their current bytes.