input-service/src/models.py

26 lines
628 B
Python
Raw Normal View History

2020-03-25 02:54:59 +01:00
#!/usr/bin/env python3
import db
from sqlalchemy.sql import func
"""
Flask Restful endpoints
"""
__author__ = '@tormakris'
__copyright__ = "Copyright 2020, Birbnetes Team"
__module_name__ = "models"
__version__text__ = "1"
class SampleMetadata(db.Model):
"""
SQLAlchemy model of metadata entries
"""
id = db.Column(db.Integer, primary_key=True, auto_increment=True)
timestamp = db.Column(db.TIMESTAMP, nullable=False, server_default=func.now())
device_id = db.Column(db.String, nullable=False)
device_date = db.Column(db.DateTime, nullable=False)
tag = db.Column(db.String, nullable=False)