o
    !\i	                     @   s   d Z ddlmZmZmZmZmZ ddlmZ ddl	m	Z	 ddl
Z
ddlmZ G dd dee
jZG d	d
 d
eZG dd deZdS )z-Match and MatchEvent models (football schema)    )ColumnIntegerString
ForeignKeyDateTime)relationship)datetimeN)Basec                   @   s$   e Zd ZdZdZdZdZdZdZdS )MatchStatuszMatch status	scheduledlivefinished	postponed	cancelledN)	__name__
__module____qualname____doc__	SCHEDULEDLIVEFINISHED	POSTPONED	CANCELLED r   r   W/var/www/www-root/data/www/176.119.141.140/sports-predictor/app/core/db/models/match.pyr
   
   s    r
   c                   @   s$  e Zd ZdZdZeedddZeeedddZ	eeedZ
eeed	ddZeeed	ddZed
edddZeeejjddZedeZedeZeeZeedddZeeejdZeeejejdZedddZedddZedegddZedegddZ eddddZ!edddZ"dS )Matchz
Match/GamematchesTprimary_keyindexz
leagues.idFnullablez
seasons.idteams.id
kickoff_at)r!   r   )defaultr   ft_homeft_away)uniquer   )r$   )r$   onupdateLeagueback_populatesSeasonTeamhome_matches)foreign_keysr+   away_matches
MatchEventmatchzall, delete-orphan)r+   cascade
PredictionN)#r   r   r   r   __tablename__r   r   idr   	league_id	season_idhome_team_idaway_team_idr   
match_dater   r
   r   valuestatus
home_score
away_score
source_url	source_idr   utcnow
created_at
updated_atr   leagueseason	home_team	away_teameventspredictionsr   r   r   r   r      s,    

r   c                   @   sr   e Zd ZdZdZeedddZeeedddZ	ee
ddZeeedZee
ZeeZee
Zed	d
dZdS )r1   zMatch event (goal, card, etc.)match_eventsTr   z
matches.idFr    r"   r   rI   r*   N)r   r   r   r   r5   r   r   r6   r   match_idr   
event_typeteam_idplayer_nameminutedescriptionr   r2   r   r   r   r   r1   5   s    r1   )r   
sqlalchemyr   r   r   r   r   sqlalchemy.ormr   r   enumapp.core.db.databaser	   strEnumr
   r   r1   r   r   r   r   <module>   s    	"