forked from platypush/platypush
Use Float instead of Numeric on NumericSensor table.
The Numeric type may have casting/rounding issues with SQLite.
This commit is contained in:
parent
5763c5e0ba
commit
3615a269fe
1 changed files with 4 additions and 4 deletions
|
@ -3,10 +3,10 @@ import logging
|
||||||
from sqlalchemy import (
|
from sqlalchemy import (
|
||||||
Boolean,
|
Boolean,
|
||||||
Column,
|
Column,
|
||||||
|
Float,
|
||||||
ForeignKey,
|
ForeignKey,
|
||||||
Integer,
|
Integer,
|
||||||
JSON,
|
JSON,
|
||||||
Numeric,
|
|
||||||
String,
|
String,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -44,9 +44,9 @@ if 'numeric_sensor' not in Base.metadata:
|
||||||
id = Column(
|
id = Column(
|
||||||
Integer, ForeignKey(Device.id, ondelete='CASCADE'), primary_key=True
|
Integer, ForeignKey(Device.id, ondelete='CASCADE'), primary_key=True
|
||||||
)
|
)
|
||||||
value = Column(Numeric)
|
value = Column(Float)
|
||||||
min = Column(Numeric)
|
min = Column(Float)
|
||||||
max = Column(Numeric)
|
max = Column(Float)
|
||||||
unit = Column(String)
|
unit = Column(String)
|
||||||
|
|
||||||
__mapper_args__ = {
|
__mapper_args__ = {
|
||||||
|
|
Loading…
Reference in a new issue