# from services.web.project.libraries.flask_login_pum import UserMixin
# from services.web.project import db

from ..libraries.flask_login_pum import UserMixin
from .. import db

class User(UserMixin, db.Model):
    _table_args__ = {'extend_existing': True}
    id = db.Column(db.Integer, primary_key=True) # primary keys are required by SQLAlchemy
    email = db.Column(db.String(100), unique=True)
    password = db.Column(db.String(100))
    name = db.Column(db.String(1000))
    roles = db.Column(db.String(100), nullable=False, server_default='user')
    admin = db.Column(db.Integer, nullable=False, server_default='0')
    log_type = db.Column(db.String(10), nullable=False, server_default='none')
    plex_id = db.Column(db.Integer, nullable=False, server_default='0')
    blocked = db.Column(db.Integer, nullable=False, server_default='0')