¡@

Home 

OpenStack Study: 021_set_engine_mysql_innodb.py

OpenStack Index

**** CubicPower OpenStack Study ****

def upgrade(migrate_engine):

    meta = MetaData()

    meta.bind = migrate_engine

    if migrate_engine.name == "mysql":

        d = migrate_engine.execute("SHOW TABLE STATUS WHERE Engine!='InnoDB';")

        for row in d.fetchall():

            table_name = row[0]

            if table_name in tables:

                migrate_engine.execute("ALTER TABLE %s Engine=InnoDB" %

                                       table_name)

**** CubicPower OpenStack Study ****

def downgrade(migrate_engine):

    pass