SchemaObject provides a simple, easy to use Python object interface to a MySQL database schema. You can effortlessly write tools to test, validate, sync, migrate, or manage your schema as well as generate the SQL necessary to make changes to it.
Verify all tables are InnoDB
import schemaobject
schema = schemaobject.SchemaObject('mysql://username:password@localhost:3306/mydb')
tables = schema.databases['mydb'].tables #or schema.selected.tables
for t in tables:
assert tables[t].options['engine'].value == 'InnoDB'
Verify our MySQL instance is at least version 5.1
import schemaobject
schema = schemaobject.SchemaObject('mysql://username:password@localhost:3306/mydb')
assert schema.version >= '5.1.0'
Notes and Limitations
Prerequisites
Standard Installation
Download SchemaObject-0.5.3
tar xvzf SchemaObject-0.5.3.tar.gz
cd SchemaObject-0.5.2
sudo python setup.py install
Installing with easy_install
sudo easy_install schemaobject
Installing the latest development version
git clone git://github.com/mmatuson/SchemaObject.git
cd schemaobject
sudo python setup.py install
To upgrade to a new version of SchemaObject, see Upgrading
Schema Sync - a MySQL schema versioning and migration utility
SchemaObject is under active development and released under the Apache License, Version 2.0.
You can obtain a copy of the latest source code from the Git repository, or fork it on Github.
You can report bugs via the SchemaObject Issues page.
Comments, questions, and feature requests can be sent to code at matuson dot com