|
From: Maxim <wz...@us...> - 2005-09-09 14:44:52
|
Update of /cvsroot/bbps/bbps/sql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6578 Modified Files: upgrade_schema.sql Log Message: * made orphanes searchable * fixed most of the bugs that were on sf.net * making some extra comments * made upgrade schema more complete * for more info, see CHANGELOG entries for September 7 and September 9, 2005. Index: upgrade_schema.sql =================================================================== RCS file: /cvsroot/bbps/bbps/sql/upgrade_schema.sql,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** upgrade_schema.sql 6 Sep 2005 18:07:36 -0000 1.1 --- upgrade_schema.sql 9 Sep 2005 14:44:45 -0000 1.2 *************** *** 4,5 **** --- 4,36 ---- # Insert new stylesheet into the Admin-Panel INSERT INTO `bbps_admin` VALUES ('css', 'black.css', 'Green on black stylesheet'); + + # Creating UNIQUES and dropping unused indexes + ALTER TABLE `bbps_keywords` DROP INDEX `keyword_id` + + # Updating database to hold correct relations table without dupes + create temporary table temp select distinct * from bbps_rel_keywords_bookmarks; + + DROP TABLE IF EXISTS `db_bbps`.`bbps_rel_keywords_bookmarks` ; + + CREATE TABLE `db_bbps`.`bbps_rel_keywords_bookmarks` ( + `bbps_rel_keyword_id` int( 10 ) unsigned NOT NULL default '0', + `bbps_rel_bookmark_id` int( 10 ) unsigned NOT NULL default '0', + UNIQUE KEY `rel_keyword_id` ( `bbps_rel_keyword_id` , `bbps_rel_bookmark_id` ) + ) TYPE = MYISAM ; + + insert into bbps_rel_keywords_bookmarks select * from temp; + + # Partial updating of keywords table. Not done yet. + + create temporary table temp2 select * from bbps_keywords group by upper(bbps_keyword_name); + + DROP TABLE IF EXISTS `db_bbps`.`bbps_keywords` ; + + CREATE TABLE `db_bbps`.`bbps_keywords` ( + `bbps_keyword_id` int( 11 ) NOT NULL AUTO_INCREMENT , + `bbps_keyword_name` varchar( 32 ) default NULL , + PRIMARY KEY ( `bbps_keyword_id` ) , + UNIQUE KEY `bbps_keyword_name` ( `bbps_keyword_name` ) + ) TYPE = MYISAM ; + + insert into bbps_keywords select * from temp2; |