From ea3567245524b6b39677ed38aad1febaf5def512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Thu, 6 Aug 2020 16:57:40 +0200 Subject: [PATCH] use postgres specific UUID --- src/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/models.py b/src/models.py index e74d8b4..260a056 100644 --- a/src/models.py +++ b/src/models.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import enum +from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.sql import func from db import db @@ -28,7 +29,7 @@ class SensorStatusEnum(enum.Enum): class Device(db.Model): __tablename__ = 'device' id = db.Column(db.Integer, primary_key=True) - sensorid = db.Column(db.UUID, nullable=False) + sensorid = db.Column(UUID(as_uuid=True), nullable=False) status = db.Column(db.Enum(DeviceStatusEnum), nullable=False) url = db.Column(db.String, nullable=False) lastupdate = db.Column(db.TIMESTAMP, nullable=False, server_default=func.now(), onupdate=func.current_timestamp())