-- ── The teardown ────────────────────────────────────────────────────────── -- -- Destructive, and run ONLY by an explicit admin purge (MODULE_API.md §2.6). -- Nothing on the boot path executes this file, and uninstalling the module does -- not either: removing an operator's data is a second decision they make on -- purpose, offered inside the uninstall flow and confirmed separately. -- -- It exists because `schema.sql` does. A module that can create tables and -- cannot drop them leaves an operator with orphaned data and no supported way to -- remove it, so core refuses to load a module that declares one without the -- other. -- -- **Drop in the reverse of creation order**, which this file depends on: -- `rust_server_state` carries a foreign key into `rust_servers`, so dropping the -- parent first fails on the constraint — and a purge that fails halfway leaves -- exactly the orphaned data it exists to remove. -- -- What does NOT belong here: rows written into core's tables. Core prunes what -- it knows this module registered, because it is the side that knows which -- registrant owned what. -- Phase 7b. DROP TABLE IF EXISTS rust_settings; DROP TABLE IF EXISTS rust_config_writes; -- Phase 7. Children before parents: every one of these carries a foreign key -- into `rust_servers`, `users` or `rust_perm_groups`. DROP TABLE IF EXISTS rust_perm_catalogue; DROP TABLE IF EXISTS rust_perm_sync; DROP TABLE IF EXISTS rust_perm_revocations; DROP TABLE IF EXISTS rust_perm_drift; DROP TABLE IF EXISTS rust_perm_pushed; DROP TABLE IF EXISTS rust_perm_grants; DROP TABLE IF EXISTS rust_perm_group_members; DROP TABLE IF EXISTS rust_perm_group_permissions; DROP TABLE IF EXISTS rust_perm_groups; DROP TABLE IF EXISTS rust_account_links; DROP TABLE IF EXISTS rust_ingest_cursor; DROP TABLE IF EXISTS rust_presence; DROP TABLE IF EXISTS rust_events; DROP TABLE IF EXISTS rust_gather_totals; DROP TABLE IF EXISTS rust_player_wipe_stats; DROP TABLE IF EXISTS rust_players; DROP TABLE IF EXISTS rust_wipes; DROP TABLE IF EXISTS rust_server_state; DROP TABLE IF EXISTS rust_servers;