Skip to content

Instantly share code, notes, and snippets.

View bumuckl's full-sized avatar

Christoph Baur bumuckl

View GitHub Profile
@bumuckl
bumuckl / activation method
Created September 20, 2011 11:56
Croogo plugin: Setup tables on activation
App::import('Model', 'CakeSchema');
App::import('Model', 'ConnectionManager');
include_once(APP.'plugins'.DS.'pluginname'.DS.'config'.DS.'schema'.DS.'schema.php');
$db = ConnectionManager::getDataSource('default');
//Get all available tables
$tables = $db->listSources();
$CakeSchema = new CakeSchema();