Grow the Reading.degrees_f
column
sometimes a probe will report a wacky temperature, but we should record it even so
This commit is contained in:
parent
ad03e32f77
commit
5d81ac19a6
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8; mode: python -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8; -*-
|
||||
"""${message}
|
||||
|
||||
Revision ID: ${up_revision}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
# -*- coding: utf-8; -*-
|
||||
"""grow degrees
|
||||
|
||||
Revision ID: 75c09e11543c
|
||||
Revises: 76d52bb064b8
|
||||
Create Date: 2017-08-05 12:50:50.093173
|
||||
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '75c09e11543c'
|
||||
down_revision = u'76d52bb064b8'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import rattail.db.types
|
||||
|
||||
|
||||
|
||||
def upgrade():
|
||||
|
||||
# reading
|
||||
op.alter_column('reading', 'degrees_f', type_=sa.Numeric(precision=8, scale=4))
|
||||
|
||||
|
||||
def downgrade():
|
||||
|
||||
# reading
|
||||
op.alter_column('reading', 'degrees_f', type_=sa.Numeric(precision=7, scale=4))
|
|
@ -1,4 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8; -*-
|
||||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
|
@ -151,7 +151,7 @@ class Reading(Base):
|
|||
cascade='all, delete-orphan'))
|
||||
|
||||
taken = sa.Column(sa.DateTime(), nullable=False, default=datetime.datetime.utcnow)
|
||||
degrees_f = sa.Column(sa.Numeric(precision=7, scale=4), nullable=False)
|
||||
degrees_f = sa.Column(sa.Numeric(precision=8, scale=4), nullable=False)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.degrees_f)
|
||||
|
|
Loading…
Reference in a new issue