Also add Kick to dataset

This commit is contained in:
Joakim Hellsén 2026-03-17 00:07:22 +01:00
commit 563266d8cc
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
3 changed files with 22 additions and 12 deletions

View file

@ -19,9 +19,9 @@ if TYPE_CHECKING:
class Command(BaseCommand):
"""Create a compressed SQL dump of the Twitch dataset tables."""
"""Create a compressed SQL dump of the Twitch and Kick dataset tables."""
help = "Create a compressed SQL dump of the Twitch dataset tables."
help = "Create a compressed SQL dump of the Twitch and Kick dataset tables."
def add_arguments(self, parser: ArgumentParser) -> None:
"""Define arguments for the backup command."""
@ -59,9 +59,14 @@ class Command(BaseCommand):
timestamp: str = timezone.localtime(timezone.now()).strftime("%Y%m%d-%H%M%S")
output_path: Path = output_dir / f"{prefix}-{timestamp}.sql.zst"
allowed_tables = _get_allowed_tables("twitch_")
allowed_tables = sorted({
*_get_allowed_tables("twitch_"),
*_get_allowed_tables("kick_"),
})
if not allowed_tables:
self.stdout.write(self.style.WARNING("No twitch tables found to back up."))
self.stdout.write(
self.style.WARNING("No twitch or kick tables found to back up."),
)
return
if django_connection.vendor == "postgresql":