# models.py

from flask_login import UserMixin
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

class User(UserMixin, db.Model):
    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))

class Carburante(db.Model):
    identificador = db.Column(db.Integer, primary_key=True)
    fecha = db.Column(db.Date())
    vehiculo = db.Column(db.String(20))
    kms = db.Column(db.Integer)
    litros = db.Column(db.DECIMAL(10,3))    
    descuento = db.Column(db.DECIMAL(10,2))
    precioxlitro = db.Column(db.DECIMAL(10,3))
    importe = db.Column(db.DECIMAL(10,2))

class Vehiculos(db.Model):
  identificador = db.Column(db.Integer, primary_key=True)
  marca = db.Column(db.String(20))
  modelo = db.Column(db.String(20))
  matricula = db.Column(db.String(20))
