"""Update service_usage table

Revision ID: 58bbe565915
Revises: 3b8cf0c138b
Create Date: 2015-07-20 15:12:18.559865

"""

# revision identifiers, used by Alembic.
revision = '58bbe565915'
down_revision = '3b8cf0c138b'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()





def upgrade_account():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('customer', sa.Column('locale', sa.String(length=32), nullable=True))
    op.add_column('service_usage', sa.Column('tariff_id', sa.Integer(), nullable=True))
    op.add_column('service_usage', sa.Column('usage_volume', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_service_usage_tariff_id'), 'service_usage', ['tariff_id'], unique=False)
    op.create_index(op.f('ix_service_usage_usage_volume'), 'service_usage', ['usage_volume'], unique=False)
    ### end Alembic commands ###


def downgrade_account():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_service_usage_usage_volume'), table_name='service_usage')
    op.drop_index(op.f('ix_service_usage_tariff_id'), table_name='service_usage')
    op.drop_column('service_usage', 'usage_volume')
    op.drop_column('service_usage', 'tariff_id')
    op.drop_column('customer', 'locale')
    ### end Alembic commands ###


def upgrade_fitter():
    pass


def downgrade_fitter():
    pass

