# Database Models
from . import db # that SQLAlchemy Object in __init__.py
from flask_login import UserMixin
from sqlalchemy.sql import func

class User(db.Model, UserMixin): # User Database
   id = db.Column(db.Integer, primary_key=True)
   email = db.Column(db.String(150), unique=True)
   password = db.Column(db.String(150))
   firstname = db.Column(db.String(150))
   lastname = db.Column(db.String(150))
   age = db.Column(db.Integer)
   gender = db.Column(db.String(1))
   description = db.Column(db.String(300))
   profile_image = db.Column(db.String(150))
   focus = db.Column(db.Integer)

class Message(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    sender = db.Column(db.Integer,) # User id
    recipient = db.Column(db.Integer)
    message = db.Column(db.String(10000))
    datestamp = db.Column(db.DateTime(timezone=True), default=func.now())
