From 2c2fc025eb6bfdb1f4d6a5c4032d123857949120 Mon Sep 17 00:00:00 2001 From: guille Date: Mon, 30 Jan 2023 07:01:05 -0500 Subject: [PATCH] Correct error in db table creation (user_applications) --- hub/persistence/models/user_applications.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hub/persistence/models/user_applications.py b/hub/persistence/models/user_applications.py index d4c856af..978803f8 100644 --- a/hub/persistence/models/user_applications.py +++ b/hub/persistence/models/user_applications.py @@ -7,7 +7,7 @@ Project Coder Guille Gutierrez Guillermo.GutierrezMorote@concordia.ca import datetime -from sqlalchemy import Column, Integer, ForeignKey +from sqlalchemy import Column, Integer, ForeignKey, PrimaryKeyConstraint from sqlalchemy import DateTime from hub.persistence.db_config import Base @@ -23,6 +23,7 @@ class UserApplications(Base): created = Column(DateTime, default=datetime.datetime.utcnow) updated = Column(DateTime, default=datetime.datetime.utcnow) + __table_args__ = (PrimaryKeyConstraint(user_id, application_id),) def __init__(self, user_id, application_id): self.user_id = user_id