Move backup path from servers to backup

Add uuid field to backups
This commit is contained in:
amcmanu3 2024-02-08 20:25:32 -05:00
parent 8e199dcd67
commit e59b624025
2 changed files with 5 additions and 2 deletions

View File

@ -48,7 +48,6 @@ class ServersController(metaclass=Singleton):
name: str, name: str,
server_uuid: str, server_uuid: str,
server_dir: str, server_dir: str,
backup_path: str,
server_command: str, server_command: str,
server_file: str, server_file: str,
server_log_file: str, server_log_file: str,
@ -83,7 +82,6 @@ class ServersController(metaclass=Singleton):
name, name,
server_uuid, server_uuid,
server_dir, server_dir,
backup_path,
server_command, server_command,
server_file, server_file,
server_log_file, server_log_file,

View File

@ -1,3 +1,4 @@
import uuid
import logging import logging
import datetime import datetime
from peewee import ( from peewee import (
@ -9,6 +10,7 @@ from peewee import (
TextField, TextField,
AutoField, AutoField,
BooleanField, BooleanField,
UUIDField,
) )
from playhouse.shortcuts import model_to_dict from playhouse.shortcuts import model_to_dict
@ -120,6 +122,9 @@ class Schedules(BaseModel):
# Backups Class # Backups Class
# ********************************************************************************** # **********************************************************************************
class Backups(BaseModel): class Backups(BaseModel):
backup_id = UUIDField(primary_key=True, default=uuid.uuid4)
backup_name = CharField(default="New Backup")
backup_location = CharField(default="")
excluded_dirs = CharField(null=True) excluded_dirs = CharField(null=True)
max_backups = IntegerField() max_backups = IntegerField()
server_id = ForeignKeyField(Servers, backref="backups_server") server_id = ForeignKeyField(Servers, backref="backups_server")