from datetime import datetime
from main import DB
from .room import Room
from .user import User


class Message(DB.Model):
    """Model Message"""
    id = DB.Column(DB.Integer, primary_key=True)
    data = DB.Column(DB.String(1000))
    user_id = DB.Column(DB.Integer, DB.ForeignKey('user.id'), nullable=False)
    room_id = DB.Column(DB.Integer, DB.ForeignKey('room.id'), nullable=False)
    user = DB.relationship('User')
    room = DB.relationship('Room')
    posted_at = DB.Column(DB.DateTime, nullable=False, default=datetime.utcnow)

877e4d8fba79341290a35c4ab0d43e8277d17539
<mask token>

<mask token>


class Message(DB.Model):
    <mask token>
    id = DB.Column(DB.Integer, primary_key=True)
    data = DB.Column(DB.String(1000))
    user_id = DB.Column(DB.Integer, DB.ForeignKey('user.id'), nullable=False)
    room_id = DB.Column(DB.Integer, DB.ForeignKey('room.id'), nullable=False)
    user = DB.relationship('User')
    room = DB.relationship('Room')
    posted_at = DB.Column(DB.DateTime, nullable=False, default=datetime.utcnow)

<mask token>


class Message(DB.Model):
    """Model Message"""
    id = DB.Column(DB.Integer, primary_key=True)
    data = DB.Column(DB.String(1000))
    user_id = DB.Column(DB.Integer, DB.ForeignKey('user.id'), nullable=False)
    room_id = DB.Column(DB.Integer, DB.ForeignKey('room.id'), nullable=False)
    user = DB.relationship('User')
    room = DB.relationship('Room')
    posted_at = DB.Column(DB.DateTime, nullable=False, default=datetime.utcnow)

from datetime import datetime
from main import DB
from .room import Room
from .user import User


class Message(DB.Model):
    """Model Message"""
    id = DB.Column(DB.Integer, primary_key=True)
    data = DB.Column(DB.String(1000))
    user_id = DB.Column(DB.Integer, DB.ForeignKey('user.id'), nullable=False)
    room_id = DB.Column(DB.Integer, DB.ForeignKey('room.id'), nullable=False)
    user = DB.relationship('User')
    room = DB.relationship('Room')
    posted_at = DB.Column(DB.DateTime, nullable=False, default=datetime.utcnow)
