browser-go-api/models/Message.py

21 lines
567 B
Python
Raw Permalink Normal View History

2019-10-04 22:00:47 +00:00
from app import db, ma
2019-10-02 03:18:41 +00:00
import enum
2019-10-02 03:26:40 +00:00
class Message(db.Model):
2019-10-02 20:55:09 +00:00
__tablename__ = "messages"
__table_args__ = {'extend_existing': True}
2019-10-02 03:18:41 +00:00
2019-10-10 21:57:29 +00:00
class Players(enum.Enum):
BLACK = "The player taking black stones"
WHITE = "The player taking white stones"
2019-10-02 20:55:09 +00:00
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
date = db.Column(db.DateTime(), nullable=False)
content = db.Column(db.String(200), nullable=False)
2019-10-02 03:18:41 +00:00
2019-10-02 20:55:09 +00:00
# foreign key
2019-10-13 17:15:03 +00:00
move = db.Column(db.ForeignKey("moves.id"), nullable=False)
2019-10-02 03:18:41 +00:00
def __init__(self):
pass