"""add_min_max_to_sensor

Revision ID: f55c254c3edd
Revises: 13c555c2aab0
Create Date: 2020-10-16 16:35:10.739312

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'f55c254c3edd'
down_revision = '13c555c2aab0'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('day_log', 'day')
    op.drop_column('hour_log', 'hour')
    op.drop_column('minute_log', 'minute')
    op.drop_column('month_log', 'month')
    op.add_column('sensor_log', sa.Column('max_humidity', sa.DECIMAL(precision=3, scale=1), nullable=True))
    op.add_column('sensor_log', sa.Column('max_power', sa.DECIMAL(precision=6, scale=2), nullable=True))
    op.add_column('sensor_log', sa.Column('max_temperature', sa.DECIMAL(precision=3, scale=1), nullable=True))
    op.add_column('sensor_log', sa.Column('min_humidity', sa.DECIMAL(precision=3, scale=1), nullable=True))
    op.add_column('sensor_log', sa.Column('min_power', sa.DECIMAL(precision=6, scale=2), nullable=True))
    op.add_column('sensor_log', sa.Column('min_temperature', sa.DECIMAL(precision=3, scale=1), nullable=True))
    op.drop_column('week_log', 'week')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('week_log', sa.Column('week', sa.SMALLINT(), autoincrement=False, nullable=True))
    op.drop_column('sensor_log', 'min_temperature')
    op.drop_column('sensor_log', 'min_power')
    op.drop_column('sensor_log', 'min_humidity')
    op.drop_column('sensor_log', 'max_temperature')
    op.drop_column('sensor_log', 'max_power')
    op.drop_column('sensor_log', 'max_humidity')
    op.add_column('month_log', sa.Column('month', sa.SMALLINT(), autoincrement=False, nullable=True))
    op.add_column('minute_log', sa.Column('minute', sa.SMALLINT(), autoincrement=False, nullable=True))
    op.add_column('hour_log', sa.Column('hour', sa.SMALLINT(), autoincrement=False, nullable=True))
    op.add_column('day_log', sa.Column('day', sa.SMALLINT(), autoincrement=False, nullable=True))
    # ### end Alembic commands ###
