From f4bf96c43f2de5431406dbb6ac96256172cf762e Mon Sep 17 00:00:00 2001 From: Paul Farault Date: Thu, 2 Nov 2023 09:55:53 +0100 Subject: [PATCH] refactor: rename deployment and operation tables --- tdp/core/models/deployment_log.py | 2 +- tdp/core/models/operation_log.py | 4 ++-- tdp/core/models/sch_status_log.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tdp/core/models/deployment_log.py b/tdp/core/models/deployment_log.py index e9555d98..c89d6d61 100644 --- a/tdp/core/models/deployment_log.py +++ b/tdp/core/models/deployment_log.py @@ -61,7 +61,7 @@ class DeploymentLog(Base): Hold past and current deployment information. """ - __tablename__ = "deployment_log" + __tablename__ = "deployment" id: Mapped[int] = mapped_column(primary_key=True, doc="Deployment log id.") options: Mapped[Optional[dict]] = mapped_column( diff --git a/tdp/core/models/operation_log.py b/tdp/core/models/operation_log.py index 7ef0997e..0bf549f4 100644 --- a/tdp/core/models/operation_log.py +++ b/tdp/core/models/operation_log.py @@ -23,10 +23,10 @@ class OperationLog(Base): Hold past and current operation information linked to a deployment. """ - __tablename__ = "operation_log" + __tablename__ = "operation" deployment_id: Mapped[int] = mapped_column( - ForeignKey("deployment_log.id"), primary_key=True, doc="Deployment log id." + ForeignKey("deployment.id"), primary_key=True, doc="Deployment log id." ) operation_order: Mapped[int] = mapped_column( primary_key=True, doc="Operation order." diff --git a/tdp/core/models/sch_status_log.py b/tdp/core/models/sch_status_log.py index 2c950181..f969d7ed 100644 --- a/tdp/core/models/sch_status_log.py +++ b/tdp/core/models/sch_status_log.py @@ -64,7 +64,7 @@ class SCHStatusLog(Base): doc="Source of the status log.", ) deployment_id: Mapped[Optional[int]] = mapped_column( - ForeignKey("deployment_log.id"), + ForeignKey("deployment.id"), doc="Related deployment log id (if applicable).", ) message: Mapped[Optional[str]] = mapped_column(