"""Custom service

Revision ID: 5ff6324d4f
Revises: 114df3b64e8
Create Date: 2015-06-15 19:45:19.742675

"""

# revision identifiers, used by Alembic.
revision = '5ff6324d4f'
down_revision = '114df3b64e8'
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.create_table('service',
    sa.Column('service_id', sa.Integer(), nullable=False),
    sa.Column('measure_id', sa.String(length=32), nullable=True),
    sa.Column('mutable', sa.Boolean(), nullable=True),
    sa.Column('deleted', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('service_id')
    )
    op.create_table('service_description',
    sa.Column('language', sa.String(length=2), nullable=False),
    sa.Column('service_id', sa.Integer(), nullable=False),
    sa.Column('localized_description', sa.String(length=254), nullable=True),
    sa.ForeignKeyConstraint(['service_id'], ['service.service_id'], ),
    sa.PrimaryKeyConstraint('language', 'service_id')
    )
    op.create_table('service_localization',
    sa.Column('language', sa.String(length=2), nullable=False),
    sa.Column('service_id', sa.Integer(), nullable=False),
    sa.Column('localized_name', sa.String(length=254), nullable=True),
    sa.ForeignKeyConstraint(['service_id'], ['service.service_id'], ),
    sa.PrimaryKeyConstraint('language', 'service_id'),
    sa.UniqueConstraint('localized_name', 'language', name='uix_service_localization')
    )
    ### end Alembic commands ###


def downgrade_account():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('service_localization')
    op.drop_table('service_description')
    op.drop_table('service')
    ### end Alembic commands ###


def upgrade_fitter():
    pass


def downgrade_fitter():
    pass

