#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

"""Fix host ID length in VM names table

Revision ID: 24427b3a5c95
Revises: 4f70135dc089
Create Date: 2019-11-26 14:18:11.909757

"""

# revision identifiers, used by Alembic.
revision = '24427b3a5c95'
down_revision = '4f70135dc089'

from alembic import op
import sqlalchemy as sa


def upgrade():
    # Just drop and re-create the table - plugin will repopulate it
    op.drop_table('apic_aim_vm_name_updates')
    op.create_table(
        'apic_aim_vm_name_updates',
        sa.Column('purpose', sa.String(36), nullable=False),
        sa.PrimaryKeyConstraint('purpose'),
        sa.Column('host_id', sa.String(255), nullable=False),
        sa.Column('last_incremental_update_time', sa.DateTime()),
        sa.Column('last_full_update_time', sa.DateTime()),
    )


def downgrade():
    pass
