1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 21:14:18 +00:00
pds-2021-g2-nest/nest_backend/database/tables/Composed.py

14 lines
499 B
Python
Raw Normal View History

"""
This module defines the Composed database class.
"""
2021-05-07 17:46:14 +00:00
from ..base import ext
2021-05-07 17:46:14 +00:00
class Composed(ext.Model):
__tablename__ = "composed"
2021-05-11 16:45:40 +00:00
rid = ext.Column(ext.Integer, ext.ForeignKey("repository.id", ondelete="CASCADE"), primary_key=True)
2021-05-07 17:46:14 +00:00
snowflake = ext.Column(ext.String, ext.ForeignKey("tweet.snowflake"), primary_key=True)
# Relationships
2021-05-07 17:46:14 +00:00
repository = ext.relationship("Repository", back_populates="tweets")
tweet = ext.relationship("Tweet", back_populates="repositories")