Index: g2.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/g2/g2.install,v retrieving revision 1.4.2.2 diff -u -p -r1.4.2.2 g2.install --- g2.install 25 Aug 2007 13:15:47 -0000 1.4.2.2 +++ g2.install 7 May 2008 07:27:01 -0000 @@ -11,6 +11,54 @@ $_g2_install_er = error_reporting(E_ALL | E_STRICT); /** + * Define the structure of the non-core tables used by G2. + * + * Schema API does not define it, but thes tables should have UTF-8 + * as their default charset + * + * @return array + */ +function g2_schema() { + /** + * Additional fields in G2 entries + */ + $schema['g2_node'] = array( + 'fields' => array( + /** + * G2 does not currently revision the additional information it stores + * about its entries, so it does not need to keep the vid + */ + 'nid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0), + 'period' => array('type' => 'varchar', 'length' => 50, 'not null' => false), + 'complement' => array('type' => 'text', 'size' => 'medium', 'not null' => false), + 'origin' => array('type' => 'text', 'size' => 'medium', 'not null' => false), + ), + 'primary key' => array('nid'), + 'unique keys' => array(), + 'indexes' => array(), + ); + + /** + * G2 per-node referer stats for (future) link exchange + */ + $schema['g2_referer'] = array( + 'fields' => array( + 'nid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0), + 'referer' => array('type' => 'varchar', 'length' => 128, 'not null' => true, 'default' => ''), + 'incoming' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0), + ), + 'indexes' => array(), + 'primary key' => array('nid', 'referer'), + 'unique keys' => array(), + 'indexes' => array( + 'referer' => array('referer'), + ), + ); + + return $schema; +} + +/** * Drupal install function for 4.7 * http://drupal.org/node/51220 * @return void @@ -52,4 +100,4 @@ function g2_uninstall() } error_reporting($_g2_install_er); -unset($_g2_install_er); \ No newline at end of file +unset($_g2_install_er); Index: g2.schema =================================================================== RCS file: g2.schema diff -N g2.schema --- g2.schema 25 Aug 2007 13:14:26 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,64 +0,0 @@ - array - ( - /** - * G2 does not currently revision the additional information it stores - * about its entries, so it does not need to keep the vid - */ - 'nid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0), - 'period' => array('type' => 'varchar', 'length' => 50, 'not null' => false), - 'complement' => array('type' => 'text', 'size' => 'medium', 'not null' => false), - 'origin' => array('type' => 'text', 'size' => 'medium', 'not null' => false), - ), - 'primary key' => array('nid'), - 'unique keys' => array(), - 'indexes' => array(), - ); - - /** - * G2 per-node referer stats for (future) link exchange - */ - $schema['g2_referer'] = array - ( - 'fields' => array - ( - 'nid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0), - 'referer' => array('type' => 'varchar', 'length' => 128, 'not null' => true, 'default' => ''), - 'incoming' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0), - ), - 'indexes' => array(), - 'primary key' => array('nid', 'referer'), - 'unique keys' => array(), - 'indexes' => array - ( - 'referer' => array('referer'), - ), - ); - - return $schema; - } \ No newline at end of file