

def upgrade(migrate_engine):
    meta = MetaData(bind=migrate_engine)
    migrations = Table('migrations', meta, autoload=True)
    shadow_migrations = Table('shadow_migrations', meta, autoload=True)
    enum = Enum('migration', 'resize', 'live-migration', 'evacuation', metadata=meta, name='migration_type')
    enum.create()
    migration_type = Column('migration_type', enum, nullable=True)
    if (not hasattr(migrations.c, 'migration_type')):
        shadow_migrations.create_column(migration_type)
    if (not hasattr(shadow_migrations.c, 'migration_type')):
        shadow_migrations.create_column(migration_type.copy())
    hidden = Column('hidden', Boolean, default=False)
    if (not hasattr(migrations.c, 'hidden')):
        migrations.create_column(hidden)
    if (not hasattr(shadow_migrations.c, 'hidden')):
        shadow_migrations.create_column(hidden.copy())

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/db/sqlalchemy/migrate_repo/versions/293_add_migration_type.py upgrade/VarMisuse@100/144 `migrations`->`shadow_migrations`