make uuid fields string
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c573e9f876
commit
b8b4a5849a
@ -14,16 +14,12 @@ services:
|
|||||||
- POSTGRES_DB=cnc-service
|
- POSTGRES_DB=cnc-service
|
||||||
networks:
|
networks:
|
||||||
- cnc
|
- cnc
|
||||||
volumes:
|
|
||||||
- ./postres-volume:/var/lib/postgresql/data
|
|
||||||
|
|
||||||
activemq:
|
activemq:
|
||||||
image: registry.kmlabz.com/birbnetes/activemq-artemis
|
image: registry.kmlabz.com/birbnetes/activemq-artemis
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- cnc
|
- cnc
|
||||||
volumes:
|
|
||||||
- ./artemis-volume:/var/lib/artemis-instance
|
|
||||||
|
|
||||||
cnc-service:
|
cnc-service:
|
||||||
image: registry.kmlabz.com/birbnetes/activemq-artemis
|
image: registry.kmlabz.com/birbnetes/activemq-artemis
|
||||||
|
@ -9,4 +9,3 @@ marshmallow-sqlalchemy
|
|||||||
flask-marshmallow
|
flask-marshmallow
|
||||||
paho-mqtt
|
paho-mqtt
|
||||||
flask-mqtt
|
flask-mqtt
|
||||||
psycopg2-binary
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import enum
|
import enum
|
||||||
from sqlalchemy.dialects.postgresql import UUID
|
|
||||||
from sqlalchemy.sql import func
|
from sqlalchemy.sql import func
|
||||||
from db import db
|
from db import db
|
||||||
|
|
||||||
@ -29,7 +28,7 @@ class SensorStatusEnum(enum.Enum):
|
|||||||
class Device(db.Model):
|
class Device(db.Model):
|
||||||
__tablename__ = 'device'
|
__tablename__ = 'device'
|
||||||
id = db.Column(db.Integer, primary_key=True)
|
id = db.Column(db.Integer, primary_key=True)
|
||||||
sensorid = db.Column(UUID(as_uuid=True), nullable=True)
|
sensorid = db.Column(db.String, nullable=True)
|
||||||
status = db.Column(db.Enum(DeviceStatusEnum), nullable=False)
|
status = db.Column(db.Enum(DeviceStatusEnum), nullable=False)
|
||||||
url = db.Column(db.String, nullable=False)
|
url = db.Column(db.String, nullable=False)
|
||||||
lastupdate = db.Column(db.TIMESTAMP, nullable=False, server_default=func.now(), onupdate=func.current_timestamp())
|
lastupdate = db.Column(db.TIMESTAMP, nullable=False, server_default=func.now(), onupdate=func.current_timestamp())
|
||||||
@ -38,6 +37,6 @@ class Device(db.Model):
|
|||||||
|
|
||||||
class Sensor(db.Model):
|
class Sensor(db.Model):
|
||||||
__tablename__ = 'sensor'
|
__tablename__ = 'sensor'
|
||||||
id = db.Column(UUID(as_uuid=True), primary_key=True)
|
id = db.Column(db.String, primary_key=True)
|
||||||
status = db.Column(db.Enum(SensorStatusEnum), nullable=False)
|
status = db.Column(db.Enum(SensorStatusEnum), nullable=False)
|
||||||
device_id = db.Column(UUID(as_uuid=True), db.ForeignKey('device.id'))
|
device_id = db.Column(db.String, db.ForeignKey('device.id'))
|
||||||
|
Loading…
Reference in New Issue
Block a user