Skip to content

Instantly share code, notes, and snippets.

@chrisjdavis
Created September 11, 2012 20:00
Show Gist options
  • Save chrisjdavis/3701597 to your computer and use it in GitHub Desktop.
Save chrisjdavis/3701597 to your computer and use it in GitHub Desktop.
public function action_init() {
DB::register_table( 'activity' );
}
public function action_plugin_activation( $file ) {
$q = "CREATE TABLE " . DB::table('activity') . " (
id int(11) unsigned NOT NULL AUTO_INCREMENT,
user_id int(11) DEFAULT NULL,
owner_id int(11) DEFAULT NULL,
company_id int(11) DEFAULT NULL,
parent_id int(11) DEFAULT NULL,
object_id int(11) DEFAULT NULL,
date int(11) DEFAULT NULL,
message varchar(512) DEFAULT NULL,
type int(11) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
return $sql = DB::dbdelta( $q );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment