diff --git a/tui_rsync/infrastructure/orm/database_manager.py b/tui_rsync/infrastructure/orm/database_manager.py index e5e7726..ca36e5a 100644 --- a/tui_rsync/infrastructure/orm/database_manager.py +++ b/tui_rsync/infrastructure/orm/database_manager.py @@ -1,13 +1,13 @@ from typing import List from peewee import Model, Database -from .models import BackupPlan, Destination +from .models import BackupPlanModel, DestinationModel from tui_rsync.core.ports.orm import DatabaseManagerPort class DatabaseManager(DatabaseManagerPort): models: List[Model] = [ - BackupPlan, - Destination, + BackupPlanModel, + DestinationModel, ] def __init__(self, db: Database): diff --git a/tui_rsync/infrastructure/orm/models.py b/tui_rsync/infrastructure/orm/models.py index 92e83f9..e83fc37 100644 --- a/tui_rsync/infrastructure/orm/models.py +++ b/tui_rsync/infrastructure/orm/models.py @@ -2,7 +2,7 @@ from peewee import * import uuid -class BackupPlan(Model): +class BackupPlanModel(Model): id = UUIDField(primary_key=True, default=uuid.uuid4) label = CharField() source = CharField() @@ -11,6 +11,7 @@ class BackupPlan(Model): database = DatabaseProxy() -class Destination(Model): - source = ForeignKeyField(BackupPlan, backref='destinations') +class DestinationModel(Model): + id = UUIDField(primary_key=True, default=uuid.uuid4) + source = ForeignKeyField(BackupPlanModel, backref='destinations') path = CharField()