fix(cli): db-reset now drops swarm_hosts + decky_shards

_DB_RESET_TABLES was missing the swarm tables, so drop-tables mode left
them intact. create_all doesn't alter columns on existing tables, so any
schema change to SwarmHost (like use_ipvlan) never took effect after a
reset. Child FK first (decky_shards -> swarm_hosts).
This commit is contained in:
2026-04-19 18:04:35 -04:00
parent 5df995fda1
commit 6245786289

View File

@@ -1627,13 +1627,17 @@ def sniffer_cmd(
_DB_RESET_TABLES: tuple[str, ...] = ( _DB_RESET_TABLES: tuple[str, ...] = (
# Order matters for DROP TABLE: attacker_behavior FK-references attackers. # Order matters for DROP TABLE: child FKs first.
# - attacker_behavior FK-references attackers.
# - decky_shards FK-references swarm_hosts.
"attacker_behavior", "attacker_behavior",
"attackers", "attackers",
"logs", "logs",
"bounty", "bounty",
"state", "state",
"users", "users",
"decky_shards",
"swarm_hosts",
) )