21 lines
786 B
Python
21 lines
786 B
Python
"""Abstract base class for match models (Match + TeamMatch)."""
|
|
|
|
from app.extensions import db
|
|
from app.time_utils import utc_now_naive
|
|
|
|
|
|
class BaseMatch(db.Model):
|
|
"""Shared schema for tryout-scoped matches and regular-season team matches."""
|
|
|
|
__abstract__ = True
|
|
|
|
title = db.Column(db.String(200), nullable=False)
|
|
description = db.Column(db.Text, nullable=True)
|
|
date = db.Column(db.Date, nullable=False)
|
|
start_time = db.Column(db.Time, nullable=True)
|
|
end_time = db.Column(db.Time, nullable=True)
|
|
location = db.Column(db.String(200), nullable=True)
|
|
status = db.Column(db.String(20), default='scheduled')
|
|
created_by = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)
|
|
created_at = db.Column(db.DateTime, default=utc_now_naive)
|