afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-09-07 11:34 am

[dw-free] remove legacy database tables

[commit: http://hg.dwscoalition.org/dw-free/rev/216ed3140539]

http://bugs.dwscoalition.org/show_bug.cgi?id=1710

Remove "keywords" table (pre-clustering table, replaced by userkeywords)

Patch by [personal profile] kareila.

Files modified:
  • bin/upgrading/base-data.sql
  • bin/upgrading/update-db-general.pl
  • cgi-bin/ljlib.pl
--------------------------------------------------------------------------------
diff -r c29700bccea5 -r 216ed3140539 bin/upgrading/base-data.sql
--- a/bin/upgrading/base-data.sql	Mon Sep 07 11:28:30 2009 +0000
+++ b/bin/upgrading/base-data.sql	Mon Sep 07 11:33:44 2009 +0000
@@ -853,7 +853,6 @@ REPLACE INTO schematables (des, public_b
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores S2 layer sources. Please see also the newer global InnoDB table [dbtable[s2source_inno]].', '0', 'off', NULL, 's2source');
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores Support system categories.', '1', 'insert', 'catkey=\'general\'', 'supportcat');
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores [dbtable[user]] subscriptions to Support request categories for e-mail notification of new requests.', '0', 'off', NULL, 'supportnotify');
-REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores [dbtable[userpic]] keywords. Please see also the clustered [dbtable[userkeywords]] table, used from data version 7.', '0', 'off', NULL, 'keywords');
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores \'sysban\' data - the mechanism for banning users from portions of the site based on certain criteria.', '0', 'off', NULL, 'sysban');
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores a count of generic actions. A nightly maintenance task (clean_caches) summarizes the clustered [dbtable[recentactions]] tables data here.', '0', 'off', NULL, 'actionhistory');
 REPLACE INTO schematables (des, public_browsable, redist_mode, redist_where, tablename) VALUES ('Global. Stores a history log of certain types of changes (like user e-mail changes), so the old values can be looked at by administrators or automatically retrieved. Please see also [dbtable[statushistory]].', '0', 'off', NULL, 'infohistory');
diff -r c29700bccea5 -r 216ed3140539 bin/upgrading/update-db-general.pl
--- a/bin/upgrading/update-db-general.pl	Mon Sep 07 11:28:30 2009 +0000
+++ b/bin/upgrading/update-db-general.pl	Mon Sep 07 11:33:44 2009 +0000
@@ -158,16 +158,6 @@ CREATE TABLE interests (
 
     PRIMARY KEY  (intid),
     UNIQUE interest (interest)
-)
-EOC
-
-register_tablecreate("keywords", <<'EOC');
-CREATE TABLE keywords (
-    kwid int(10) unsigned NOT NULL auto_increment,
-    keyword varchar(80) binary NOT NULL default '',
-
-    PRIMARY KEY  (kwid),
-    UNIQUE KEY kwidx (keyword)
 )
 EOC
 
@@ -976,6 +966,7 @@ register_tabledrop("urimap");
 register_tabledrop("urimap");
 register_tabledrop("syndicated_hubbub");
 register_tabledrop("oldids");
+register_tabledrop("keywords");
 
 register_tablecreate("portal", <<'EOC');
 CREATE TABLE portal (
@@ -3352,11 +3343,6 @@ register_alter(sub {
                  "ALTER TABLE memorable ".
                  "MODIFY des VARCHAR(150) NOT NULL");
     }
-    if (column_type("keywords", "keyword") eq "varchar(40) binary") {
-        do_alter("keywords",
-                 "ALTER TABLE keywords ".
-                 "MODIFY keyword VARCHAR(80) BINARY NOT NULL");
-    }
 
     #allow longer moodtheme pic URLs
     if (column_type("moodthemedata", "picurl") eq "varchar(100)") {
diff -r c29700bccea5 -r 216ed3140539 cgi-bin/ljlib.pl
--- a/cgi-bin/ljlib.pl	Mon Sep 07 11:28:30 2009 +0000
+++ b/cgi-bin/ljlib.pl	Mon Sep 07 11:33:44 2009 +0000
@@ -1509,13 +1509,9 @@ sub cmd_buffer_add
 # class:
 # des: Get the id for a keyword.
 # args: uuid?, keyword, autovivify?
-# des-uuid: User object or userid to use.  Pass this <strong>only</strong> if
-#           you want to use the [dbtable[userkeywords]] clustered table!  If you
-#           do not pass user information, the [dbtable[keywords]] table
-#           on the global will be used.
+# des-uuid: User object or userid to use.
 # des-keyword: A string keyword to get the id of.
-# returns: Returns a kwid into [dbtable[keywords]] or
-#          [dbtable[userkeywords]], depending on if you passed a user or not.
+# returns: Returns a kwid into [dbtable[userkeywords]].
 #          If the keyword doesn't exist, it is automatically created for you.
 # des-autovivify: If present and 1, automatically create keyword.
 #                 If present and 0, do not automatically create the keyword.
--------------------------------------------------------------------------------