You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
810 B

from sqlalchemy.sql import func
from app import db
class PlayerCaughtPlayer(db.Model):
__tablename__ = 'player_caught_player'
id = db.Column(db.Integer, primary_key=True, autoincrement=True, server_default='-1')
catching_player_id = db.Column(db.Integer, db.ForeignKey('player.id'), nullable=False)
caught_player_id = db.Column(db.Integer, db.ForeignKey('player.id'), nullable=False)
photo_reference = db.Column(db.String(128), unique=True, nullable=False)
timestamp = db.Column(db.DateTime, server_default=func.now(), nullable=False)
catching_player = db.relationship('Player', back_populates='player_caught_by_players', foreign_keys=[catching_player_id])
caught_player = db.relationship('Player', back_populates='player_caught_players', foreign_keys=[caught_player_id])