begin(); // Start a transaction try { $schema = new Pluf_DB_Schema($db); foreach (array('Pluf_Search_Stats', 'Pluf_Queue') as $model) { $schema->model = new $model(); $schema->createTables(); } } catch (Exception $e) { $db->rollback(); throw $e; } $db->commit(); } function Pluf_Migrations_4QueueStats_down($params=null) { $db = Pluf::db(); $db->begin(); // Start a transaction try { $schema = new Pluf_DB_Schema($db); foreach (array('Pluf_Queue', 'Pluf_Search_Stats') as $model) { $schema->model = new $model(); $schema->dropTables(); } } catch (Exception $e) { $db->rollback(); throw $e; } $db->commit(); }