from sqlalchemy.sql import func from app import db class PlayerFoundObjective(db.Model): __tablename__ = 'player_found_objective' objective_id = db.Column(db.Integer, db.ForeignKey('objective.id'), primary_key=True, nullable=False, server_default='-1') player_id = db.Column(db.Integer, db.ForeignKey('player.id'), primary_key=True, nullable=False, server_default='-1') timestamp = db.Column(db.DateTime, server_default=func.now(), nullable=False) player = db.relationship('Player', back_populates='player_found_objectives') objective = db.relationship('Objective', back_populates='objective_found_by')