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