diff --git a/rattail_tempmon/db/alembic/versions/34041e1032a2_add_client_probe_notes.py b/rattail_tempmon/db/alembic/versions/34041e1032a2_add_client_probe_notes.py new file mode 100644 index 0000000..3a62edd --- /dev/null +++ b/rattail_tempmon/db/alembic/versions/34041e1032a2_add_client_probe_notes.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8; -*- +"""add client, probe notes + +Revision ID: 34041e1032a2 +Revises: e9eb7fc0a451 +Create Date: 2018-09-28 12:24:11.348627 + +""" + +from __future__ import unicode_literals, absolute_import + +# revision identifiers, used by Alembic. +revision = '34041e1032a2' +down_revision = u'e9eb7fc0a451' +branch_labels = None +depends_on = None + +from alembic import op +import sqlalchemy as sa +import rattail.db.types + + + +def upgrade(): + + # client + op.add_column('client', sa.Column('notes', sa.Text(), nullable=True)) + + # probe + op.add_column('probe', sa.Column('notes', sa.Text(), nullable=True)) + + +def downgrade(): + + # probe + op.drop_column('probe', 'notes') + + # client + op.drop_column('client', 'notes') diff --git a/rattail_tempmon/db/model.py b/rattail_tempmon/db/model.py index bf1bfd2..c490f39 100644 --- a/rattail_tempmon/db/model.py +++ b/rattail_tempmon/db/model.py @@ -60,6 +60,10 @@ class Client(Base): not set, a default of 60 seconds will be assumed. """) + notes = sa.Column(sa.Text(), nullable=True, doc=""" + Any arbitrary notes for the client. + """) + enabled = sa.Column(sa.Boolean(), nullable=False, default=False) online = sa.Column(sa.Boolean(), nullable=False, default=False) @@ -117,6 +121,10 @@ class Probe(Base): therm_status_timeout = sa.Column(sa.Integer(), nullable=False) status_alert_timeout = sa.Column(sa.Integer(), nullable=False) + notes = sa.Column(sa.Text(), nullable=True, doc=""" + Any arbitrary notes for the probe. + """) + status = sa.Column(sa.Integer(), nullable=True) status_changed = sa.Column(sa.DateTime(), nullable=True) status_alert_sent = sa.Column(sa.DateTime(), nullable=True)