input-service/src/models.py

26 lines
646 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())
2020-03-25 03:57:07 +01:00
device_id = db.Column(db.Integer, nullable=False)
2020-03-25 02:54:59 +01:00
device_date = db.Column(db.DateTime, nullable=False)
2020-03-31 14:46:46 +02:00
tag = db.Column(db.String(32), nullable=False, unique=True)