Skip to content

Instantly share code, notes, and snippets.

@ptica
Created September 19, 2011 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptica/1226385 to your computer and use it in GitHub Desktop.
Save ptica/1226385 to your computer and use it in GitHub Desktop.
function after($event = array()) {
// on MYSQL: retype columns to mediumtext, as we store whole api response
// that is longer than std 64kB of mysql text
if (isset($event['create']) && $event['create'] == 'saved_queries') {
$db = &ConnectionManager::getDataSource($this->connection);
$sql = 'alter table saved_queries modify content mediumtext';
if (substr($db->config['driver'], 0, 5) == 'mysql') $db->execute($sql);
}
if (isset($event['create']) && $event['create'] == 'contracts') {
$db = &ConnectionManager::getDataSource($this->connection);
$sql = 'alter table contracts modify saved_query_content mediumtext';
if (substr($db->config['driver'], 0, 5) == 'mysql') $db->execute($sql);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment