MishkaCmsCore.Runtime.Resources.Changes.ScheduleSiteTeardown (Mishka CMS Core v0.0.1)

Copy Markdown View Source

Schedules the background teardown of a site's in-memory artifacts on :permanent_destroy.

A site's compiled modules and asset names are keyed by the site name, and its child rows (pages/layouts/error pages/components) are removed by ON DELETE CASCADE the moment the site row is deleted — bypassing Ash, so no per-record job fires. This change therefore captures the module-backed record keys before the delete, and on success closes the request gate (SiteState.delete/1) and enqueues SiteTeardownWorker to purge the rest.

It sets defer_runtime: true so the generic SendToOban change skips the site destroy job — teardown fully owns the permanent-delete path.

See MishkaCmsCore.Runtime.Workers.SiteTeardownWorker and MishkaCmsCore.Runtime.Resources.Changes.SendToOban.