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:
Lance Edgar 2017-08-05 12:54:08 -05:00
parent ad03e32f77
commit 5d81ac19a6
3 changed files with 36 additions and 3 deletions

View file

@ -1,5 +1,5 @@
# -*- coding: utf-8; mode: python -*-
# -*- coding: utf-8 -*-
# -*- coding: utf-8; -*-
"""${message}
Revision ID: ${up_revision}

View file

@ -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))

View file

@ -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)