-- ── 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. 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;