sql_app/models: fix inverted table links

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2022-04-03 15:51:36 +03:00
parent 7dab731337
commit 866182c25e

View File

@ -28,5 +28,5 @@ class IotEntity(Base):
class UserAuthToIoTDev(Base):
__tablename__ = "user_iot_link"
user_id = Column(Integer, ForeignKey('iot_entities.id'), primary_key=True, index=True)
iot_entity_id = Column(Integer, ForeignKey('user_accounts.id'), primary_key=True, index=True)
user_id = Column(Integer, ForeignKey('user_accounts.id'), primary_key=True, index=True)
iot_entity_id = Column(Integer, ForeignKey('iot_entities.id'), primary_key=True, index=True)