class LikedImages(db.Model): id = db.Column(db.Integer, primary_key=True) image_link = db.Column(db.String, db.ForeignKey('images.link'), nullable=False) user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False) owner_id = db.Column(db.Integer, nullable=False)
class Messages(db.Model): id = db.Column(db.Integer, primary_key=True) message = db.Column(db.String(600), nullable=False) first_user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False) second_user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False) message_time_utc = db.Column(db.String(200), nullable=False)
class Podcast(db.Model): # we want to change the name of this table as it is basically a subscriptions table. id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey("users.id"), nullable=False) name = db.Column(db.String(500)) rss_feed_url = db.Column(db.String(2000)) podcast_API_id = db.Column(db.Integer)
class MuseumActivities(db.Model): id = db.Column(db.Integer, primary_key=True) museum_id = db.Column(db.Integer, db.ForeignKey('museum_info.id'), nullable=False) activity_name = db.Column(db.String(500)) activity_description = db.Column(db.String(500)) number_of_kids_taken = db.Column(db.Integer) low_age_range_of_child_taken = db.Column(db.Integer) high_age_range_of_child_taken = db.Column(db.Integer)
class History(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) user_id = db.Column(db.Integer, db.ForeignKey("users.id")) episode_title = db.Column(db.String) episode_summary = db.Column(db.String) episode_url = db.Column(db.String) time_stamp_accessed = db.Column(db.DateTime, default=datetime.now()) current_time_listened = db.Column(db.Integer) parent_podcast_id = db.Column(db.Integer) parent_podcast_art_url = db.Column(db.String)
class Playlists(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(500)) user_id = db.Column(db.Integer, db.ForeignKey("users.id")) def __init__(self, name, user_id): self.name = name self.user_id = user_id def save(self): db.session.add(self) db.session.commit() items = relationship("PlaylistItems")
class PlaylistItems(db.Model): id = db.Column(db.Integer, primary_key=True) playlist_id = db.Column(db.Integer, db.ForeignKey("playlists.id")) episode_title = db.Column(db.String) episode_summary = db.Column(db.String) episode_url = db.Column(db.String)
class Images(db.Model): id = db.Column(db.Integer, primary_key=True) link = db.Column(db.String(120), nullable=False, unique=True) user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False) likedimages = db.relationship('LikedImages', backref='images', lazy=True)