protected static function _migrate_sql_rdo($db)
{
$migration = new Horde_Db_Migration_Base($db);
/* Cleanup potential left-overs. */
try {
$migration->dropTable('test_someeagerbaseobjects');
$migration->dropTable('test_somelazybaseobjects');
$migration->dropTable('test_relatedthings');
$migration->dropTable('test_manytomanya');
$migration->dropTable('test_manytomanyb');
$migration->dropTable('test_manythrough');
} catch (Horde_Db_Exception $e) {
}
$t = $migration->createTable('test_someeagerbaseobjects', array('autoincrementKey' => 'baseobject_id'));
$t->column('relatedthing_id', 'integer');
$t->column('atextproperty', 'string');
$t->end();
$t = $migration->createTable('test_somelazybaseobjects', array('autoincrementKey' => 'baseobject_id'));
$t->column('relatedthing_id', 'integer');
$t->column('atextproperty', 'string');
$t->end();
$t = $migration->createTable('test_relatedthings', array('autoincrementKey' => 'relatedthing_id'));
$t->column('relatedthing_textproperty', 'string', array('limit' => 255, 'null' => false));
$t->column('relatedthing_intproperty', 'integer', array('null' => false));
$t->end();
$t = $migration->createTable('test_manytomanya', array('autoincrementKey' => 'a_id'));
$t->column('a_intproperty', 'integer', array('null' => false));
$t->end();
$t = $migration->createTable('test_manytomanyb', array('autoincrementKey' => 'b_id'));
$t->column('b_intproperty', 'integer', array('null' => false));
$t->end();
$t = $migration->createTable('test_manythrough');
$t->column('a_id', 'integer');
$t->column('b_id', 'integer');
$t->end();
$migration->migrate('up');
}