Skip to content

feat: reset change history for unarchive events - #233

Merged
massimoalbarello merged 1 commit into
mainfrom
codex/reset-resource-history
Oct 25, 2026
Merged

massimoalbarello merged 1 commit into
mainfrom
codex/reset-resource-history

Conversation

@massimoalbarello

Copy link
Copy Markdown
Owner

Why

Dashboard recovery in #232 needs an explicit unarchived history event, but the deployed change-log constraint rejects it. SQLite cannot extend that constraint with ALTER TABLE. For this upgrade, existing change history is disposable, so we deliberately start a fresh log instead of copying old history into a replacement table.

How

Add migration 0016 to drop and recreate resource_change and its index with unarchived allowed. Deploying this migration deletes all existing change history on the instance; entities, pages, assets, records, and revisions are retained. The migration runs transactionally once, and subsequent startups preserve newly recorded events.

Expose the action in the history API and UI so #232 can record restorations. Keep applied migrations and the migration runner unchanged, and update the compatibility policy to protect deployed schemas while allowing breaking API changes.

@massimoalbarello
massimoalbarello merged commit 63186f8 into main Oct 25, 2026
10 checks passed
@massimoalbarello
massimoalbarello deleted the codex/reset-resource-history branch October 25, 2026 14:46
massimoalbarello added a commit that referenced this pull request Oct 25, 2026
## Why

Archiving preserves entities, pages, and assets, but the dashboard
provides no way to recover them when an agent archives one by mistake.
This builds on merged #233, which reset the disposable change log and
prepared the unarchived history action.

## How

Add independent status and visibility filters to all three collections.
All options stay selectable, and Archived + Public shows the normal
empty result. Archived resources remain read-only, with Unarchive
available only in full detail. Blocked attempts and request errors use a
dismissible dialog matching publication feedback.

Restoration checks archived dependencies, preserves content and
revisions, rebuilds portrait references, and records an unarchived event
with a success notification. Future archives retain their search
indexes; older missing indexes are neither rebuilt nor backfilled. The
change-log reset is already in main through #233.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant