Add startup scheme

This commit is contained in:
Rene Arumetsa
2026-07-26 21:36:26 +03:00
parent c40c871a4b
commit 94fe57a596
5 changed files with 42 additions and 1 deletions

View File

@@ -573,6 +573,15 @@ async def do_spam_jail(user_id: int) -> None:
# ---------------------------------------------------------------------------
# Public helpers
# ---------------------------------------------------------------------------
async def missing_schema_fields() -> list[str]:
"""Compare the live PocketBase collection schema against every field the
bot persists. PocketBase silently drops writes to undeclared fields, so
any name returned here means broken features without error messages."""
live = await pb_client.get_collection_fields()
expected = set(_default_user()) | {"user_id"}
return sorted(expected - live)
async def get_all_users_raw() -> dict[str, "UserData"]:
"""Return a snapshot of all user records."""
records = await pb_client.list_all_records()