browser-go-api/models/Message.py

20 lines
566 B
Python
Raw 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
class Players(enum.Enum):
BLACK = "The player taking black stones"
WHITE = "The player taking white stones"
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-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
move = db.Column(db.Integer, db.ForeignKey("moves.id"), nullable=False)
2019-10-02 03:18:41 +00:00
def __init__(self):
pass