from chfi import db
from datetime import datetime
from sqlalchemy import Numeric


class Sensor(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    part = db.Column(db.String(200), nullable=False)
    data = db.Column(Numeric(precision=6, scale=2), default=0)
    create_date = db.Column(db.DateTime, default=datetime.now)


class Auth(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(200), unique=True,nullable=False)
    password = db.Column(db.String(200), nullable=False)
    email = db.Column(db.String(200), unique=True,nullable=False)
    create_date = db.Column(db.DateTime, default=datetime.now)