Index: clipper.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/clipper/clipper.install,v retrieving revision 1.1 diff -u -F^f -r1.1 clipper.install --- clipper.install 4 Apr 2006 19:24:19 -0000 1.1 +++ clipper.install 1 Aug 2006 17:42:12 -0000 @@ -5,13 +5,15 @@ function clipper_install() { switch ($GLOBALS['db_type']) { case 'mysql': case 'mysqli': - db_query("CREATE TABLE relations ( + db_query("CREATE TABLE {relations} ( rid int(10) NOT NULL auto_increment, left_id int(10) NOT NULL default '0', - relationship text NOT NULL, right_id int(10) NOT NULL default '0', + relationship text NOT NULL, weight tinyint(3) NOT NULL default '0', - KEY rid (rid) + PRIMARY KEY rid (rid), + KEY (right_id), + KEY (left_id) ) ENGINE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;"); break; case 'pgsql': @@ -21,4 +23,12 @@ function clipper_install() { function clipper_update_1() { return _system_update_utf8(array('relations')); +} + +function clipper_update_2() { + $ret = update_sql('ALTER TABLE {relations} ADD PRIMARY KEY ( rid ) '); + $ret = update_sql('ALTER TABLE {relations} DROP INDEX rid '); + $ret = update_sql('ALTER TABLE {relations} ADD KEY ( right_id ) '); + $ret = update_sql('ALTER TABLE {relations} ADD KEY ( left_id ) '); + return $ret; } \ No newline at end of file