# -*- coding: utf-8 -*-

from sqlalchemy.sql.expression import func

from nitrate import db


class User(db.Model):
    __tablename__ = 'nitrate_users'

    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(30), unique=True, index=True,
                         nullable=False)
    first_name = db.Column(db.String(30), nullable=False, default='')
    last_name = db.Column(db.String(30), nullable=False, default='')
    email = db.Column(db.String(70), nullable=True)
    password = db.Column(db.String(256), nullable=False)

    created_on = db.Column(db.DateTime, nullable=False)
    updated_on = db.Column(db.DateTime, nullable=False)
