
from sqlalchemy import Column, Integer, MetaData, String, Table

meta = MetaData()

instances = Table('instances', meta,
        Column('id', Integer(),  primary_key=True, nullable=False),
        )

instances_vm_mode = Column('vm_mode',
                           String(length=255, convert_unicode=False,
                                  assert_unicode=None, unicode_error=None,
                                  _warn_on_bytestring=False),
                           nullable=True)


def upgrade(migrate_engine):
    # Upgrade operations go here. Don't create your own engine;
    # bind migrate_engine to your metadata
    meta.bind = migrate_engine

    instances.create_column(instances_vm_mode)


def downgrade(migrate_engine):
    meta.bind = migrate_engine

    instances.drop_column('vm_mode')


from sqlalchemy import Column, Integer, MetaData, String, Table

meta = MetaData()

instances = Table('instances', meta, autoload=True)

instances_vm_mode = Column('vm_mode',
                           String(length=255, convert_unicode=False,
                                  assert_unicode=None, unicode_error=None,
                                  _warn_on_bytestring=False),
                           nullable=True)


def upgrade(migrate_engine):
    # Upgrade operations go here. Don't create your own engine;
    # bind migrate_engine to your metadata
    meta.bind = migrate_engine

    instances.create_column(instances_vm_mode)


def downgrade(migrate_engine):
    meta.bind = migrate_engine

    instances.drop_column('vm_mode')

Load table schema automatically instead of stubbing out
Load table schema automatically instead of stubbing out

  
  from sqlalchemy import Column, Integer, MetaData, String, Table
  
  meta = MetaData()
  
- instances = Table('instances', meta,
+ instances = Table('instances', meta, autoload=True)
-         Column('id', Integer(),  primary_key=True, nullable=False),
-         )
  
  instances_vm_mode = Column('vm_mode',
                             String(length=255, convert_unicode=False,
                                    assert_unicode=None, unicode_error=None,
                                    _warn_on_bytestring=False),
                             nullable=True)
  
  
  def upgrade(migrate_engine):
      # Upgrade operations go here. Don't create your own engine;
      # bind migrate_engine to your metadata
      meta.bind = migrate_engine
  
      instances.create_column(instances_vm_mode)
  
  
  def downgrade(migrate_engine):
      meta.bind = migrate_engine
  
      instances.drop_column('vm_mode')
  
Load table schema automatically instead of stubbing out
## Code Before:

from sqlalchemy import Column, Integer, MetaData, String, Table

meta = MetaData()

instances = Table('instances', meta,
        Column('id', Integer(),  primary_key=True, nullable=False),
        )

instances_vm_mode = Column('vm_mode',
                           String(length=255, convert_unicode=False,
                                  assert_unicode=None, unicode_error=None,
                                  _warn_on_bytestring=False),
                           nullable=True)


def upgrade(migrate_engine):
    # Upgrade operations go here. Don't create your own engine;
    # bind migrate_engine to your metadata
    meta.bind = migrate_engine

    instances.create_column(instances_vm_mode)


def downgrade(migrate_engine):
    meta.bind = migrate_engine

    instances.drop_column('vm_mode')

## Instruction:
Load table schema automatically instead of stubbing out
## Code After:

from sqlalchemy import Column, Integer, MetaData, String, Table

meta = MetaData()

instances = Table('instances', meta, autoload=True)

instances_vm_mode = Column('vm_mode',
                           String(length=255, convert_unicode=False,
                                  assert_unicode=None, unicode_error=None,
                                  _warn_on_bytestring=False),
                           nullable=True)


def upgrade(migrate_engine):
    # Upgrade operations go here. Don't create your own engine;
    # bind migrate_engine to your metadata
    meta.bind = migrate_engine

    instances.create_column(instances_vm_mode)


def downgrade(migrate_engine):
    meta.bind = migrate_engine

    instances.drop_column('vm_mode')
