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,
server_uuid: str,
server_dir: str,
backup_path: str,
server_command: str,
server_file: str,
server_log_file: str,
@ -83,7 +82,6 @@ class ServersController(metaclass=Singleton):
name,
server_uuid,
server_dir,
backup_path,
server_command,
server_file,
server_log_file,

View File

@ -1,3 +1,4 @@
import uuid
import logging
import datetime
from peewee import (
@ -9,6 +10,7 @@ from peewee import (
TextField,
AutoField,
BooleanField,
UUIDField,
)
from playhouse.shortcuts import model_to_dict
@ -120,6 +122,9 @@ class Schedules(BaseModel):
# Backups Class
# **********************************************************************************
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)
max_backups = IntegerField()
server_id = ForeignKeyField(Servers, backref="backups_server")