from app import db class NotificationPlayer(db.Model): __tablename__ = 'notification_player' notification_id = db.Column(db.Integer, db.ForeignKey('notification.id'), primary_key=True, nullable=False) game_player_id = db.Column(db.Integer, db.ForeignKey('game_player.id'), primary_key=True, nullable=False) been_shown = db.Column(db.Boolean, server_default='0', nullable=False) notification = db.relationship('Notification', back_populates='notification_recipients') recipient = db.relationship('GamePlayer', back_populates='player_notifications')