Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

5731 lines (4362 sloc) 331.319 kb
# This is the upgrade file for SQL. What does this mean to you?
# If you are a developer you should leave notes here as to what
# was done and when. This includes inserts, alter tables and deletions.
# Changes should always be appended, and when a tag is applied,
# an End/Start comment should be appended.
#
# "End of X" means that tag X was applied "here" (at this point in
# the file, on the date given)..
# "Start of Y" is just intended to clarify that work on the next tag
# after X started at the same time that X was tagged.
#
# $Id$
#
# BEGIN tf23's additions
# for required changes to update a site from fry to devel
# this matches cvs diff -r fry -r T_2_3_0_10 -U3 sql/mysql/slashschema_create.sql
#
# So if you are upgrading a site from 2.2.x, you should start here
# and apply all the changes below. Simply pasting in the whole
# list almost certainly won't work, since we have several notes
# where you need to run a brief perl script or something; you will
# need to read down it and apply those brief moments of human
# intelligence. Sorry. We plan to build a tool to automate this
# upgrade process... someday. - Jamie 2003/03/31
ALTER TABLE vars CHANGE name name varchar(48) DEFAULT '' NOT NULL;
ALTER TABLE accesslist CHANGE uid uid mediumint UNSIGNED NOT NULL;
ALTER TABLE blocks ADD rss_template varchar(30);
ALTER TABLE blocks ADD items smallint NOT NULL DEFAULT '0';
ALTER TABLE blocks ADD FOREIGN KEY (rss_template) REFERENCES templates(name);
ALTER TABLE sections ADD FOREIGN KEY (feature_story) REFERENCES stories(sid);
DROP TABLE IF EXISTS story_topics;
CREATE TABLE story_topics (
id int(5) NOT NULL auto_increment,
sid varchar(16) NOT NULL default '',
tid smallint(5) unsigned default NULL,
FOREIGN KEY (sid) REFERENCES stories(sid),
FOREIGN KEY (tid) REFERENCES topics(tid),
PRIMARY KEY (id),
INDEX tid (tid),
INDEX sid (sid)
) TYPE = myisam;
DROP TABLE IF EXISTS string_param;
CREATE TABLE string_param (
param_id smallint UNSIGNED NOT NULL auto_increment,
type varchar(16) NOT NULL,
code varchar(16) NOT NULL,
name varchar(32) NOT NULL,
UNIQUE code_key (type,code),
PRIMARY KEY (param_id)
) TYPE = myisam;
DROP TABLE IF EXISTS submission_param;
CREATE TABLE submission_param (
param_id mediumint UNSIGNED NOT NULL auto_increment,
subid varchar(15) NOT NULL,
name varchar(32) DEFAULT '' NOT NULL,
value text NOT NULL,
UNIQUE submission_key (subid,name),
PRIMARY KEY (param_id)
) TYPE = myisam;
ALTER TABLE templates ADD COLUMN journal_last_entry_date datetime;
DROP TABLE IF EXISTS users_hits;
CREATE TABLE users_hits (
uid mediumint UNSIGNED NOT NULL,
lastclick TIMESTAMP,
hits int DEFAULT '0' NOT NULL,
PRIMARY KEY (uid)
) TYPE = myisam;
INSERT into users_hits (uid) select uid from users;
ALTER TABLE users_index CHANGE COLUMN exsect exsect varchar(255);
ALTER TABLE users_info ADD people blob;
DROP TABLE IF EXISTS temp_zoo;
# END tf23's additions
# (from sometime prior to when we had this file)
ALTER TABLE users_info DROP COLUMN hits;
# LCR 2/7, 10PM T_2_3_0_9
# To fix the data in users to add the + sign to positive values -Brian
UPDATE users_param SET value = CONCAT("+",value) WHERE (name LIKE "reason%" OR name LIKE "people_bonus%") AND value LIKE "_";
# Upgrade Zoo to latest schema, once you do this run the script
# "plugins/Zoo/rebuildPeople" - Brian
CREATE TABLE temp_zoo SELECT * FROM people;
DROP TABLE IF EXISTS people;
CREATE TABLE people (
id MEDIUMINT UNSIGNED NOT NULL auto_increment,
uid MEDIUMINT UNSIGNED NOT NULL,
person MEDIUMINT UNSIGNED NOT NULL,
type enum("friend","foe"),
perceive enum("fan","freak"),
fof MEDIUMINT UNSIGNED NOT NULL DEFAULT 0,
eof MEDIUMINT UNSIGNED NOT NULL DEFAULT 0,
UNIQUE degree_of_separation (uid,person),
PRIMARY KEY (id)
);
INSERT INTO people (uid,person,type) SELECT uid, person, type from temp_zoo;
# This was removed from the bonus system a while ago. -Brian
ALTER TABLE users_comments DROP anon_comments;
# Changes for sections
# Make sure you run install-plugin for sections and delete the old sections.pl from your
# slashcode theme. -Brian
ALTER TABLE sections ADD url char(32) DEFAULT '' NOT NULL;
ALTER TABLE sections ADD hostname char(32)DEFAULT '' NOT NULL;
# Well we didn't need either of these two indexes. We got the same data from two
# other rows. -Brian
ALTER TABLE comments DROP INDEX uid;
ALTER TABLE comments DROP INDEX sid;
# More key stuff. We had a number of duplicate keys in
# users. I should really spend time and go through the
# entire schema. -Brian
ALTER TABLE users DROP INDEX login;
ALTER TABLE users ADD INDEX login (nickname,uid,passwd);
ALTER TABLE users DROP INDEX chk4user;
ALTER TABLE users ADD INDEX chk4user (realemail,nickname);
ALTER TABLE users DROP INDEX nickname_lookup;
ALTER TABLE users DROP INDEX chk4email;
# Few more.
ALTER TABLE moderatorlog DROP INDEX sid_2;
ALTER TABLE moderatorlog ADD INDEX sid_2 (cid,uid,sid);
ALTER TABLE moderatorlog DROP INDEX cid;
# new multi topics stuff
DROP TABLE IF EXISTS story_topics;
CREATE TABLE story_topics (
id int(5) NOT NULL auto_increment,
sid varchar(16) NOT NULL default '',
tid smallint(5) unsigned default NULL,
FOREIGN KEY (sid) REFERENCES stories(sid),
FOREIGN KEY (tid) REFERENCES topics(tid),
PRIMARY KEY (id),
INDEX sid (sid),
INDEX tid (tid)
) TYPE=MyISAM;
# New var to regulate comment display - Jamie
INSERT INTO vars (name, value, description) VALUES ('comments_max_email_len','40','Max num of chars of fakeemail to display in comment header');
# End of T_2_3_0_10, Start of T_2_3_0_11
# New attribute for stories
ALTER TABLE stories ADD day_published date DEFAULT '0000-00-00' NOT NULL;
ALTER TABLE stories ADD INDEX published (day_published);
UPDATE stories SET day_published=time;
INSERT INTO vars (name, value, description) VALUES ('comments_moddable_archived','0','Are comments in discussions that have been archived moderatable?');
INSERT INTO vars (name, value, description) VALUES ('comments_moddable_hours','336','Num hours after being posted that a comment may be moderated');
# End of T_2_3_0_?, Start of R_2_3_0_13
# This was added to sql/mysql/slashschema_create.sql ... but is NOT yet live.
# Brian says "list" is being yanked and "type" is part of code that PatG
# hasn't yet committed, so I'm ignoring it for now... this is here in
# upgrades as a reminder.
# added new column to section_extras to accomodate pulldows
# (key/values stored in string_param)
ALTER TABLE section_extras add column type enum("text","list") DEFAULT 'text' NOT NULL;
ALTER TABLE string_param modify column code varchar(32) NOT NULL;
# End of R_2_3_0_13, Start of T_2_3_0_14
ALTER TABLE users_hits ADD COLUMN hits_bought_today SMALLINT UNSIGNED DEFAULT 0 NOT NULL AFTER hits_bought;
ALTER TABLE sessions add column last_subid varchar(15);
ALTER TABLE sessions add column last_sid varchar(16);
# End of R_2_3_0_14, Start of T_2_3_0_15
# add ECODE tag ...
UPDATE vars SET value=CONCAT(value,'|ECODE') WHERE name='approvedtags';
# Message threshold
INSERT INTO vars (name, value, description) VALUES ('message_threshold','1','Default threshold for a comment to trigger a message');
# End of R_2_3_0_15, Start of T_2_3_0_16
# Browser bug workaround
INSERT INTO vars (name, value, description) VALUES ('comment_nonstartwordchars','.,;:/','Chars which cannot start a word (will be forcibly separated from the rest of the word by a space) - this works around a Windows/MSIE "widening" bug - set blank for no action');
# Size changes and new column -Brian
ALTER TABLE sections CHANGE url url varchar(128) DEFAULT '' NOT NULL;
ALTER TABLE sections CHANGE hostname hostname varchar(128) DEFAULT '' NOT NULL;
ALTER TABLE sections ADD cookiedomain varchar(128) DEFAULT '' NOT NULL;
# freshenup.pl chunks article .shtml files
INSERT INTO vars (name, value, description) VALUES ('freshenup_max_stories','100','Maximum number of article.shtml files to write at a time in freshenup.pl');
# Start of T_2_3_0_20
# New hooks table
DROP TABLE IF EXISTS hooks;
CREATE TABLE hooks (
id mediumint(5) UNSIGNED NOT NULL auto_increment,
param varchar(50) DEFAULT '' NOT NULL,
class varchar(100) DEFAULT '' NOT NULL,
subroutine varchar(100) DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE hook_param (param,class,subroutine)
) TYPE = myisam;
ALTER TABLE stories ADD COLUMN qid MEDIUMINT UNSIGNED DEFAULT NULL;
# Same as below
#perl -MSlash::Test=virtusername -le '$qs = $slashdb->sqlSelectAllHashrefArray("pollquestions.qid AS qid, pollquestions.sid AS sid", "pollquestions, stories", "pollquestions.sid=stories.sid"); for my $hr (@$qs) { my($q,$s) = ($hr->{qid}, $hr->{sid}); my $sq=$slashdb->sqlQuote($s); print "$q -> $s"; $slashdb->sqlUpdate("stories", { qid => $q }, "sid=$sq") or die "\tFAILED" }'
# I have never tried to do a "source" from a file but I suspect it will work -Brian
select CONCAT('UPDATE stories SET qid=',qid,' WHERE sid="',sid,'";') into outfile "/tmp/pollquestions.sql" from pollquestions;
source /tmp/pollquestions.sql
# (and, once we're convinced everything works)
ALTER TABLE pollquestions DROP COLUMN sid;
# End of T_2_3_0_20, Start of T_2_3_0_21
# New submission_param table
DROP TABLE IF EXISTS submission_param;
CREATE TABLE submission_param (
param_id mediumint UNSIGNED NOT NULL auto_increment,
subid varchar(15) NOT NULL,
name varchar(32) DEFAULT '' NOT NULL,
value text NOT NULL,
UNIQUE submission_key (subid,name),
PRIMARY KEY (param_id)
) TYPE = myisam;
# This is the multi section topic stuff for Foundries
INSERT INTO code_param (type, code, name) VALUES ('section_topic_types',1,'default');
ALTER TABLE section_topics ADD COLUMN type smallint UNSIGNED NOT NULL;
UPDATE section_topics SET type=1;
ALTER TABLE section_extras MODIFY COLUMN type ENUM("text","list","topics") DEFAULT 'text' NOT NULL;
# Autopoll update
ALTER TABLE pollquestions ADD COLUMN autopoll enum("no","yes") DEFAULT 'no' NOT NULL;
# Submissions
ALTER TABLE submissions ADD COLUMN weight float DEFAULT '0' NOT NULL;
#New index_handler bits
INSERT INTO vars (name, value, description) VALUES ('index_handler','index.pl','The perl servlet to call for conections to the root of the server.');
ALTER TABLE sections ADD COLUMN index_handler varchar(30) DEFAULT "index.pl" NOT NULL;
ALTER TABLE sections ADD COLUMN writestatus ENUM("ok","dirty") DEFAULT 'ok' NOT NULL;
#slashd_log table
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('admin','Slashd','[% gSkin.rootdir %]/admin.pl?op=slashd',500,17);
# Note this is different than what Brian committed Wednesday morning;
# were any sites updated with that?
DROP TABLE IF EXISTS slashd_status;
CREATE TABLE slashd_status (
task varchar(50) NOT NULL default '',
next_begin DATETIME,
in_progress TINYINT NOT NULL DEFAULT '0',
last_completed DATETIME,
summary VARCHAR(255) NOT NULL DEFAULT '',
duration float(6,2) DEFAULT '0.00' NOT NULL,
PRIMARY KEY (task)
) TYPE=MyISAM;
# Remember pollBooth is now a plugin!
# Unique changes for Pat
ALTER TABLE section_topics DROP PRIMARY KEY;
ALTER TABLE section_topics ADD PRIMARY KEY (section,type,tid);
INSERT INTO string_param (type, code, name) VALUES ('yes_no','yes','yes');
INSERT INTO string_param (type, code, name) VALUES ('yes_no','no','no');
INSERT INTO vars (name, value, description) VALUES ('label_ui','0','Whether to label some things in the admin ui');
INSERT INTO vars (name, value, description) VALUES ('enable_index_topic','','set this to the value in string param for index topic \(something like "topic_4"\)');
INSERT INTO vars (name, value, description) VALUES ('get_titles','0','get the story titles');
INSERT INTO vars (name, value, description) VALUES ('organise_stories','','organise story blocks');
INSERT INTO string_param (Type, code, name) VALUES ('section_topic_type','topic_1','Default');
# another small change for topic types
ALTER TABLE section_topics MODIFY COLUMN type varchar(16) NOT NULL DEFAULT 'topic_1';
UPDATE section_topics SET type = 'topic_1' WHERE type = '1';
# Change for plugins/Subscribe (ignore if not using that plugin)
ALTER TABLE subscribe_payments ADD COLUMN method VARCHAR(6) AFTER transaction_id;
ALTER TABLE comments DROP index countreplies;
ALTER TABLE comments ADD KEY countreplies (pid,sid);
# Not read just yet but I am leaving it here as a note -Brian
ALTER TABLE blocks ADD autosubmit enum("no","yes") DEFAULT 'no' NOT NULL;
INSERT INTO vars (name, value, description) VALUES ('rss_store','0','Should we be saving incomming submissions for rss');
INSERT INTO vars (name, value, description) VALUES ('rss_expire_days','7','Number of days till we blank the data from the database (the signatures still stick around though)');
ALTER TABLE submissions DROP subid;
ALTER TABLE submissions ADD subid mediumint UNSIGNED NOT NULL PRIMARY KEY auto_increment;
ALTER TABLE sessions DROP last_subid;
ALTER TABLE sessions ADD last_subid mediumint UNSIGNED;
DROP TABLE IF EXISTS submission_param;
CREATE TABLE submission_param (
param_id mediumint UNSIGNED NOT NULL auto_increment,
subid mediumint UNSIGNED NOT NULL,
name varchar(32) DEFAULT '' NOT NULL,
value text NOT NULL,
UNIQUE submission_key (subid,name),
PRIMARY KEY (param_id)
) TYPE = myisam;
DROP TABLE IF EXISTS rss_raw;
CREATE TABLE rss_raw (
id mediumint UNSIGNED NOT NULL auto_increment,
link_signature char(32) DEFAULT '' NOT NULL,
title_signature char(32) DEFAULT '' NOT NULL,
description_signature char(32) DEFAULT '' NOT NULL,
link varchar(255) NOT NULL,
title varchar(255) NOT NULL,
description varchar(255) NOT NULL,
subid mediumint UNSIGNED,
bid varchar(30),
created datetime,
processed enum("no","yes") DEFAULT 'no' NOT NULL,
UNIQUE uber_signature (link_signature, title_signature, description_signature),
FOREIGN KEY (subid) REFERENCES submissions(subid),
FOREIGN KEY (bid) REFERENCES blocks(bid),
PRIMARY KEY (id)
) TYPE = myisam;
# A nice useful var.
INSERT INTO vars (name, value, description) VALUES ('admin_formkeys', '0', 'Do admins have to bother with formkeys?');
# End of T_2_3_0_21, Start of T_2_3_0_22
# Install GD.pm and associated libraries for plugins/HumanConf.
# GD/Text and GD/Text/Align.pm are needed too.
# These Debian packages are believed necessary:
# libfreetype6-dev libfreetype6 freetype2 libjpeg62-dev libjpeg62
# when building from source, I used freetype-2.1.0, libpng-1.2.2,
# jpeg-6b, and gd-1.8.4, and the GD module from the CPAN. -- pudge
# last night Cliff and I got it to work on Debian stable using
# libjpeg62(-dev) and xpm4g(-dev) debs, plus source compiles of
# freetype-2.1.0 and gd-1.8.4; GD had 1 error (#8) and GD::Text
# had several errors, but after force installing, they work OK
# for HumanConf purposes.
# Add signature column to submissions. Be aware that this column's final
# state does not have a default.
ALTER TABLE submissions ADD COLUMN signature varchar(32) DEFAULT '' NOT NULL;
ALTER TABLE submissions ADD UNIQUE story_signature(signature);
UPDATE submissions SET signature=MD5(story);
ALTER TABLE submissions MODIFY COLUMN signature varchar(32) NOT NULL;
# This expands blocks to get data from sites that require logins via a cookie
ALTER TABLE blocks ADD COLUMN rss_cookie varchar(255);
#We ran into URLs that were longer then 50 characters
ALTER TABLE submissions MODIFY COLUMN email varchar(255) DEFAULT '' NOT NULL;
UPDATE vars SET value=100 WHERE name="authors_unlimited";
#Needed for search, not used in submissions "yet"
INSERT INTO string_param (type, code, name) VALUES ('submission-notes','','Unclassified');
INSERT INTO string_param (type, code, name) VALUES ('submission-notes','Hold','Hold');
INSERT INTO string_param (type, code, name) VALUES ('submission-notes','Quick','Quick');
INSERT INTO string_param (type, code, name) VALUES ('submission-notes','Back','Back');
#
# Table structure for table 'subsections'
#
DROP TABLE IF EXISTS subsections;
CREATE TABLE subsections (
id smallint UNSIGNED NOT NULL auto_increment,
title varchar(30) NOT NULL,
section varchar(30) NOT NULL,
artcount mediumint DEFAULT '30' NOT NULL,
UNIQUE code_key (title,section),
FOREIGN KEY (section) REFERENCES sections(section),
PRIMARY KEY (id)
) TYPE = myisam;
# End of T_2_3_0_22, Start of T_2_3_0_23
# If using HumanConf...
ALTER TABLE humanconf_pool ADD COLUMN inuse TINYINT DEFAULT '0' NOT NULL AFTER lastused;
ALTER TABLE stories ADD subsection SMALLINT UNSIGNED DEFAULT 0 NOT NULL;
ALTER TABLE sections DROP feature_story;
ALTER TABLE accesslog ADD bytes mediumint UNSIGNED DEFAULT 0 NOT NULL;
INSERT INTO message_codes (code, type, seclev, modes) VALUES (10, 'Daily Site Stats', 100, 0);
ALTER TABLE discussions ADD last_update timestamp;
ALTER TABLE stories ADD last_update timestamp;
# End of R_2_3_0_23, Start of T_2_3_0_25
# (we skipped _24 due to an earlier glitch)
INSERT INTO vars (name, value, description) VALUES ('recent_topic_img_count','5','Number of recent topics to store in the template "recentTopics"');
INSERT INTO vars (name, value, description) VALUES ('recent_topic_txt_count','5','Number of recent topics to store in the block "recenttopics"');
INSERT INTO code_param (type, code, name) VALUES ('displaycodes_sectional', -1,'Don\'t Display');
INSERT INTO code_param (type, code, name) VALUES ('displaycodes_sectional', 1,'Display');
INSERT INTO vars (name, value, description) VALUES ('discussion_sort_order', '3', 'sort code to feed to findDiscussions');
# For plugins/Admin (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('similarstorydays', '30', 'Number of days to look back for uncommon words');
INSERT INTO vars (name, value, description) VALUES ('similarstorymaxwords', '30', 'Maximum number of top-weighted scores to search for in previous stories');
INSERT INTO vars (name, value, description) VALUES ('similarstoryminweight', '4', 'Minimum weight necessary for a story to be displayed as similar');
INSERT INTO vars (name, value, description) VALUES ('similarstorynumshow', '5', 'Maximum number of similar stories to show in admin preview');
INSERT INTO vars (name, value, description) VALUES ('uncommonstorywords', '', 'Uncommon words found in recent stories');
INSERT INTO vars (name, value, description) VALUES ('uncommonstorywords_maxlen', '65000', 'Maximum length of the uncommon words list');
INSERT INTO vars (name, value, description) VALUES ('uncommonstoryword_minlen', '3', 'Minimum length of the words in the uncommon words list');
INSERT INTO vars (name, value, description) VALUES ('uncommonstoryword_thresh', '2', 'Words occurring more often than once every this-many days are considered common');
# and this is not a DB command but needs to be done for
# each installed site that uses plugins/Admin:
# ln -s /usr/local/slash/plugins/Admin/refresh_uncommon.pl /usr/local/slash/site/sitename/tasks/
# Added for Pat for discussions -Brian
ALTER TABLE discussions ADD approved tinyint UNSIGNED DEFAULT 0 NOT NULL;
INSERT INTO vars (name, value, description) VALUES ('discussion_approval', '0', 'If this is set to 1, set all user created discussions when created to 0 so that they must be approved');
# For pudge -brian
ALTER TABLE templates ADD last_update timestamp;
# Added for some Calendar stuff I am working on -Brian
INSERT INTO code_param (type, code, name) VALUES ('months',1,'January');
INSERT INTO code_param (type, code, name) VALUES ('months',2,'Febuary');
INSERT INTO code_param (type, code, name) VALUES ('months',3,'March');
INSERT INTO code_param (type, code, name) VALUES ('months',4,'April');
INSERT INTO code_param (type, code, name) VALUES ('months',5,'May');
INSERT INTO code_param (type, code, name) VALUES ('months',6,'June');
INSERT INTO code_param (type, code, name) VALUES ('months',7,'July');
INSERT INTO code_param (type, code, name) VALUES ('months',8,'August');
INSERT INTO code_param (type, code, name) VALUES ('months',9,'September');
INSERT INTO code_param (type, code, name) VALUES ('months',10,'October');
INSERT INTO code_param (type, code, name) VALUES ('months',11,'November');
INSERT INTO code_param (type, code, name) VALUES ('months',12,'December');
# End of R_2_3_0_25, start of T_2_3_0_26
DELETE FROM sections WHERE title='All Sections' OR section='';
ALTER TABLE string_param CHANGE COLUMN name name VARCHAR(64) NOT NULL;
# This is to fix commentcounts -Brian
select concat("UPDATE discussions SET commentcount=", count(cid), " WHERE id=", sid, ";") INTO OUTFILE "/tmp/dis" from comments GROUP BY sid;
source /tmp/dis;
select concat("UPDATE stories SET commentcount=", discussions.commentcount, " WHERE discussion=", id, ";") INTO OUTFILE "/tmp/dis2" from discussions;
source /tmp/dis2;
ALTER TABLE pollanswers CHANGE COLUMN qid qid MEDIUMINT UNSIGNED NOT NULL;
ALTER TABLE formkeys CHANGE COLUMN formname formname varchar(32) DEFAULT '' NOT NULL;
# End of R_2_3_0_27, Start of T_2_3_0_28
ALTER TABLE vars CHANGE COLUMN name name varchar(48) DEFAULT '' NOT NULL;
INSERT INTO vars (name, value, description) VALUES ('lonetags','P|LI|BR|IMG','Tags that don\'t need to be closed');
INSERT INTO vars (name, value, description) VALUES ('topcomm_num','5','Number of comments wanted for the Hot Comments slashbox. Defaults to 5.');
INSERT INTO vars (name, value, description) VALUES ('anon_name_alt','An anonymous coward','Name of anonymous user to be displayed in stories');
# End of T_2_3_0_28, Start of T_2_3_0_29
INSERT INTO vars (name, value, description) VALUES ('karma_adj','-10=Terrible|-1=Bad|0=Neutral|12=Positive|25=Good|99999=Excellent','Adjectives that describe karma, used if karma_obfuscate is set (best to keep aligned with badkarma, m2_maxbonus, and goodkarma)');
INSERT INTO vars (name, value, description) VALUES ('karma_obfuscate','0','Should users see, not their numeric karma score, but instead an adjective describing their approximate karma?');
#Section stuff -Brian
ALTER TABLE sections ADD type ENUM("contained", "collected") DEFAULT 'contained' NOT NULL;
UPDATE sections SET type="contained";
INSERT INTO vars (name, value, description) VALUES ('section','index','This is the current setting for section.');
INSERT INTO sections (section, artcount, title, qid, isolate, issue, extras, type) VALUES ('index',15,'Index','',0,0,0,'collected');
ALTER TABLE blocks ADD all_sections tinyint NOT NULL DEFAULT '0';
UPDATE blocks SET all_sections=1 WHERE section="all_sections";
UPDATE blocks SET section="index" WHERE section="all_sections";
INSERT INTO vars (name, value, description) VALUES ('draconian_charrefs','0','Enable strictest-possible rules for disallowing HTML entities/character references?');
# Let's not forget to put the sections_contained table in the upgrades file
# once it becomes appropriate to do so.
# Forgot this one a little while ago I think.
INSERT INTO vars (name, value, description) VALUES ('approved_url_schemes','ftp|http|gopher|mailto|news|nntp|telnet|wais|https','Schemes that can be used in comment links without being stripped of bogus chars');
# End of T_2_3_0_29, Start of T_2_3_0_30
# Forgot this one a little while ago too.
# For plugins/Stats (ignore if you're not using that plugin):
INSERT INTO vars (name, value, description) VALUES ('mod_stats','1','Include stats on moderation in the daily admin mail?');
# End of R_2_3_0_30, Start of T_2_3_0_31
DROP TABLE IF EXISTS sections_contained;
CREATE TABLE sections_contained (
id SMALLINT UNSIGNED NOT NULL auto_increment,
container varchar(30) NOT NULL,
section varchar(30) NOT NULL,
UNIQUE (container,section),
FOREIGN KEY (container) REFERENCES sections(section),
FOREIGN KEY (section) REFERENCES sections(section),
PRIMARY KEY (id)
) TYPE = myisam;
ALTER TABLE sections ADD rewrite mediumint UNSIGNED DEFAULT '3600' NOT NULL;
ALTER TABLE sections ADD last_update timestamp;
# For plugins/Email ONLY (LC, Slashcode, etc -- NOT SLASHDOT!)
INSERT INTO message_codes (code, type, seclev, modes) VALUES (11, 'Email Story', 1, 0);
# End of R_2_3_0_31, Start of T_2_3_0_32
INSERT INTO vars (name, value, description) VALUES ('comments_perday_bykarma','-1=2|25=25|99999=50','Number of comments allowed to be posted per day, by karma score.');
INSERT INTO vars (name, value, description) VALUES ('comments_perday_anon','10','Number of comments allowed to be posted per day, by any one IPID, anonymously.');
# End of R_2_3_0_32, Start of T_2_3_0_33
INSERT INTO vars (name, value, description) VALUES ('users_bio_length','1024','Length allowed for user bio');
INSERT INTO vars (name, value, description) VALUES ('submit_forgetip_hours','720','Hours after which a submissions\'s ipid/subnetid are forgotten; set very large to disable');
INSERT INTO vars (name, value, description) VALUES ('submit_forgetip_maxrows','100000','Max number of rows to forget IPs of at once');
INSERT INTO vars (name, value, description) VALUES ('submit_forgetip_minsubid','0','Minimum subid to start forgetting IP at');
# End of T_2_3_0_34, Start of T_2_3_0_35
ALTER TABLE sections DROP isolate;
# For plugins/Stats (ignore if you're not using that plugin):
INSERT INTO vars (name, value, description) VALUES ('db_slave_lag_ignore',10000000,'Bytes of lag between master and slave DB to ignore');
# End of T_2_3_0_35, Start of T_2_3_0_36
# For Sections
INSERT INTO string_param (type, code, name) VALUES ('section_types','contained','Contained Section');
INSERT INTO string_param (type, code, name) VALUES ('section_types','collected','Collection of Sections');
SELECT concat("UPDATE sections SET qid=", value," WHERE section='index';") INTO OUTFILE "/tmp/qidproblem" from vars WHERE name="currentqid";
source /tmp/qidproblem;
# For plugins/Admin (ignore if you're not using that plugin):
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('admin','Recent','[% gSkin.rootdir %]/admin.pl?op=recent',500,18);
INSERT INTO code_param (type, code, name) VALUES ('displaycodes_sectional', -1,'Don\'t Display');
INSERT INTO code_param (type, code, name) VALUES ('displaycodes_sectional', 1,'Display');
INSERT INTO vars (name, value, description) VALUES ('discussion_sort_order', '3', 'sort code to feed to findDiscussions');
# For plugins/Stats (ignore if you're not using that plugin):
INSERT INTO vars (name, value, description) VALUES ('tailslash_stats','1','true/false log tailslash in adminmail');
# column truncated descriptions fields
ALTER TABLE rss_raw modify column description text;
# For plugins/Stats (ignore if you're not using that plugin):
ALTER TABLE stats_daily DROP INDEX day_key_pair;
ALTER TABLE stats_daily ADD COLUMN section varchar(30) DEFAULT 'index' NOT NULL;
ALTER TABLE stats_daily ADD UNIQUE day_key_pair (day,name,section);
ALTER TABLE stats_daily ADD FOREIGN KEY (section) REFERENCES sections(section);
# For plugins/Stats (ignore if you're not using that plugin):
INSERT INTO vars (name, value, description) VALUES ('op_exclude_from_countdaily','rss','Ops to omit from daily counts in adminmail');
INSERT INTO vars (name, value, description) VALUES ('mod_stats_min_repeat','2','Minimum number repeat mods to appear in mod stats');
INSERT INTO vars (name, value, description) VALUES ('cookiesecure','1','Set the secure flag in cookies if SSL is on?');
# Need a CPAN install of Date::Calc and XML::Simple!
# End of T_2_3_0_36, Start of T_2_3_0_37
# from foundries integrations
ALTER TABLE string_param MODIFY COLUMN code varchar(128) NOT NULL;
ALTER TABLE menus MODIFY COLUMN label varchar(255) DEFAULT '' NOT NULL;
ALTER TABLE rss_raw MODIFY COLUMN description text;
ALTER TABLE section_extras MODIFY COLUMN type enum("text","list","topics") DEFAULT 'text' NOT NULL;
# For submissions notes -Brian
INSERT INTO code_param (type, code, name) VALUES ('submission-state',0,'Pending');
INSERT INTO code_param (type, code, name) VALUES ('submission-state',1,'Rejected');
INSERT INTO code_param (type, code, name) VALUES ('submission-state',2,'Accepted');
# For plugins/Repository (ignore if you're not using that plugin):
DELETE FROM templates WHERE name='listRepository' AND page='repository' AND section='default';
# (this template was renamed; the new "listRepos" will be added back
# in with a "template-tool -U")
# End of T_2_3_0_37, Start of T_2_3_0_38
ALTER TABLE string_param MODIFY COLUMN code VARCHAR(128) NOT NULL;
ALTER TABLE subsections ADD COLUMN alttext VARCHAR(40) NOT NULL;
# End of T_2_3_0_38, Start of T_2_3_0_39
ALTER TABLE metamodlog ADD INDEX mmid (mmid);
# End of T_2_3_0_39, Start of T_2_3_0_40
# End of T_2_3_0_40, Start of T_2_3_0_41
# This should have been this all along -Brian
ALTER TABLE sections DROP INDEX section;
ALTER TABLE sections ADD UNIQUE section (section);
# Ok, you will have a few new things you need to do at this point.
#
# 1) If you use zoo images make sure the eof/fof gifs are installed.
#
# 2) You will also need to make sure the new task for zoo is in place if
# you want FOF/EOF
#
# 3) If number two is true then you need to run the rebuild script for
# users: "plugins/Zoo/rebuildPeople"
#
# WARNING number three may take an hour or so depending on the size of
# your database (like Slashdot will probably be an hour or so). This
# won't hurt anything but during the process users will not have their
# friends till the script gets to their account. FOF/EOF will show up
# slowly as the task works its way through them. Never run multiple
# copies of the task at once. It does 2000 entries at a time so it
# may take some time to catch up if you have a large DB. This means
# it will only process as shipped 2000*24 entries per-day. This is far
# more then what even Slashdot does in a given day. -Brian
DROP TABLE IF EXISTS people_log;
CREATE TABLE people_log (
id MEDIUMINT UNSIGNED NOT NULL auto_increment,
uid MEDIUMINT UNSIGNED NOT NULL,
person MEDIUMINT UNSIGNED NOT NULL,
type enum("friend","foe"),
action enum("add","delete"),
PRIMARY KEY (id)
);
INSERT INTO vars (name,value,description) VALUES ('zoo_process_limit','2000','Number of FOF/FOE to process during job run');
DELETE FROM vars WHERE name IN ('badreasons', 'm2_bonus', 'm2_consensus_trigger', 'm2_dissension_penalty', 'm2_maxunfair', 'm2_mincheck', 'm2_minority_trigger', 'm2_modlog_cycles', 'm2_modlog_pos', 'm2_penalty', 'm2_reward_pool', 'm2_toomanyunfair', 'reasons', 'token_retention');
INSERT INTO vars (name, value, description) VALUES ('m2_consensus_waitmult', '1', 'How long should old M2-needing mods wait for the fresh blood?');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences','0.00=0,+2,-100,-1|0.15=-5,+1,-40,-1|0.30=-1,+0.5,-20,0|0.35=0,0,-10,0|0.49=0,0,-4,0|0.60=0,0,+1,0|0.70=0,0,+2,0|0.80=+0.01,-2,+3,0|0.90=+0.02,-5,+4,0|1.00=+0.05,0,+5,+0.5','Rewards and penalties for M2ers and moderator, up to the given amount of fairness (0.0-1.0): numbers are 1, tokens to fair-voters, 2, tokens to unfair-voters, 3, tokens to moderator, and 4, karma to moderator');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_token_max','25','Maximum number of tokens a user can have, for being on the consensus side of an M2 or being judged Fair, to merit gaining tokens');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_token_min','-999999','Minimum number of tokens a user must have, for being on the consensus side of an M2 to merit gaining tokens');
UPDATE vars SET name='m2_maxbonus_karma' WHERE name='m2_maxbonus';
UPDATE vars SET description='Number of comments for meta-moderation - if more than about 15, doublecheck that users_info.mods_saved is large enough' WHERE name='m2_comments';
UPDATE vars SET description='Number of M2 votes per M1 before it is reconciled by consensus - if not odd, will be forced to next highest odd number' WHERE name='m2_consensus';
UPDATE vars SET value='2000' WHERE name='m2_batchsize';
ALTER TABLE moderatorlog ADD COLUMN m2status TINYINT DEFAULT '0' NOT NULL;
ALTER TABLE metamodlog DROP COLUMN flag;
ALTER TABLE metamodlog ADD COLUMN active TINYINT DEFAULT '1' NOT NULL;
ALTER TABLE users_info DROP COLUMN lastmmid;
ALTER TABLE users_info ADD COLUMN m2info VARCHAR(64) DEFAULT '' NOT NULL AFTER lastgranted;
ALTER TABLE users_info ADD COLUMN mods_saved VARCHAR(120) DEFAULT '' NOT NULL AFTER lastmm;
DROP TABLE IF EXISTS modreasons;
CREATE TABLE modreasons (
id tinyint UNSIGNED NOT NULL,
name char(32) DEFAULT '' NOT NULL,
m2able tinyint DEFAULT '1' NOT NULL,
listable tinyint DEFAULT '1' NOT NULL,
val tinyint DEFAULT '0' NOT NULL,
fairfrac float DEFAULT '0.5' NOT NULL,
PRIMARY KEY (id)
) TYPE=myisam;
# Insert your site's reasons, of course, if they differ.
INSERT INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 0, 'Normal', 0, 0, 0, 0.5);
INSERT INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 1, 'Offtopic', 1, 1, -1, 0.5);
INSERT INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 2, 'Flamebait', 1, 1, -1, 0.5);
INSERT INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 3, 'Troll', 1, 1, -1, 0.5);
INSERT INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 4, 'Redundant', 1, 1, -1, 0.5);
INSERT INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 5, 'Insightful', 1, 1, 1, 0.5);
INSERT INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 6, 'Interesting', 1, 1, 1, 0.5);
INSERT INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 7, 'Informative', 1, 1, 1, 0.5);
INSERT INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 8, 'Funny', 1, 1, 1, 0.5);
INSERT INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 9, 'Overrated', 0, 0, -1, 0.5);
INSERT INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES (10, 'Underrated', 0, 0, 1, 0.5);
# this is not a DB command but needs to be done for
# each installed site that uses plugins/Zoo:
# ln -s /usr/local/slash/plugins/Zoo/zoo_run_people_log.pl /usr/local/slash/site/sitename/tasks/
# End of T_2_3_0_41, Start of T_2_3_0_42
# In case you happened to create modreasons between 2002/08/28 and
# 2002/08/29, you may need to run this. If it gives errors, that
# means you're OK. If your site inserted different reasons with
# id's of 0 and 1, check them now. If you ran the above SQL updates
# as they appear now, running these won't hurt (but won't help
# either).
ALTER TABLE modreasons CHANGE id id TINYINT UNSIGNED NOT NULL PRIMARY KEY;
INSERT IGNORE INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 0, 'Normal', 0, 0, 0, 0.5);
INSERT IGNORE INTO modreasons (id, name, m2able, listable, val, fairfrac) VALUES ( 1, 'Offtopic', 1, 1, -1, 0.5);
# End of T_2_3_0_42, Start of T_2_3_0_43
# Set to email address(es) appropriate for your site, of course.
INSERT INTO vars (name, value, description) VALUES ('adminmail_mod','admin@example.com','All admin mail about moderation goes here');
# For plugins/Zoo (ignore if you're not using that plugin):
INSERT INTO vars (name, value, description) VALUES ('people_max_subscriber','400','Maximum number of friends/foes you can have');
INSERT INTO vars (name, value, description) VALUES ('m2_multicount', '5', 'Additional multiplier for M2s performed on duplicate mods (leave 0 to disable)');
# End of T_2_3_0_43, Start of T_2_3_0_44
# For plugins/Stats (ignore if you're not using that plugin):
INSERT INTO vars (name, value, description) VALUES ('mod_stats_reports','admin@example.com','Who to send daily moderation stats reports to');
# End of T_2_3_0_44, Start of T_2_3_0_45
INSERT INTO vars (name, value, description) VALUES ('m1_pointgrant_factor_fairratio', '1.3', 'Factor of fairness ratio in deciding who is eligible for moderation (1=irrelevant, 2=top user twice as likely)');
INSERT INTO vars (name, value, description) VALUES ('m1_pointgrant_factor_fairtotal', '1.3', 'Factor of fairness total in deciding who is eligible for moderation (1=irrelevant, 2=top user twice as likely)');
UPDATE section_topics SET type = 'topic_1' where type = 1;
UPDATE section_topics SET type = 'topic_2' where type = 2;
UPDATE section_topics SET type = 'topic_3' where type = 3;
UPDATE section_topics SET type = 'topic_4' where type = 4;
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('zoo','Foes','[% gSkin.rootdir %]/my/foes',1,1);
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('zoo','Freaks','[% gSkin.rootdir %]/my/freaks',1,1);
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('zoo','Friends of Friends','[% gSkin.rootdir %]/my/friends/friends',1,1);
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('zoo','Foes of Friends','[% gSkin.rootdir %]/my/friends/foes',1,1);
DELETE FROM vars WHERE name='m2_consensus_waitmult';
INSERT INTO vars (name, value, description) VALUES ('m2_consensus_waitpow', '0.8', 'Positive real number, 0.2 to 5 is sensible. Between 0 and 1, older mods are chosen for M2 preferentially. Greater than 1, newer');
# End of T_2_3_0_45, Start of T_2_3_0_46
# One more time!
REPLACE INTO menus (menu, label, value, seclev, menuorder) VALUES ('zoo','Friends','[% gSkin.rootdir %]/my/friends',1,1);
REPLACE INTO menus (menu, label, value, seclev, menuorder) VALUES ('zoo','Fans','[% gSkin.rootdir %]/my/fans',1,2);
REPLACE INTO menus (menu, label, value, seclev, menuorder) VALUES ('zoo','Foes','[% gSkin.rootdir %]/my/foes',1,3);
REPLACE INTO menus (menu, label, value, seclev, menuorder) VALUES ('zoo','Freaks','[% gSkin.rootdir %]/my/freaks',1,4);
REPLACE INTO menus (menu, label, value, seclev, menuorder) VALUES ('zoo','Friends of Friends','[% gSkin.rootdir %]/my/friends/friends',1,5);
REPLACE INTO menus (menu, label, value, seclev, menuorder) VALUES ('zoo','Foes of Friends','[% gSkin.rootdir %]/my/friends/foes',1,6);
# For plugins/Zoo (ignore if you're not using that plugin)
# Run the script "plugins/Zoo/rebuildPeople"
# working with all of you - good luck!
# Best wishes!
# End of T_2_3_0_46, Start of T_2_3_0_47
INSERT INTO vars (name, value, description) VALUES ('offer_insecure_login_link','0','Offer the user the \'totally insecure but very convenient\' index.pl login link');
# End of T_2_3_0_47, Start of T_2_3_0_48
ALTER TABLE accesslog DROP INDEX op_part;
ALTER TABLE accesslog ADD INDEX op_part (op(12), section);
INSERT INTO vars (name, value, description) VALUES ('mod_unm2able_token_cost','1','What is the token cost of performing an un-M2able mod?');
REPLACE INTO menus (menu, label, value, seclev, menuorder) VALUES ('journal','Friend\'s Journals','[% gSkin.rootdir %]/journal.pl?op=friends',0,5);
DELETE FROM menus WHERE menu="journal" AND label="Friends";
DELETE FROM menus WHERE menu="zoo";
ALTER TABLE users_info ADD COLUMN stirred mediumint UNSIGNED DEFAULT '0' NOT NULL AFTER downmods, CHANGE COLUMN lastgranted lastgranted datetime DEFAULT '0000-00-00 00:00' NOT NULL, CHANGE COLUMN lastmm lastmm datetime DEFAULT '0000-00-00 00:00' NOT NULL;
INSERT INTO vars (name, value, description) VALUES ('m2_freq','86400','In seconds, the maximum frequency which users can metamoderate');
INSERT INTO vars (name, value, description) VALUES ('mod_stir_token_cost','2','What is the token cost of having each mod point stirred?');
INSERT INTO vars (name, value, description) VALUES ('mod_token_decay_days','14','How many days of inactivity before tokens start to decay?');
INSERT INTO vars (name, value, description) VALUES ('mod_token_decay_perday','1','If inactivity, how many tokens lost per day?');
UPDATE menus SET menu='adv-admin', menuorder=1 WHERE label='Topics' AND menu='admin';
UPDATE menus SET menu='adv-admin', menuorder=2 WHERE label='Blocks' AND menu='admin';
UPDATE menus SET menu='adv-admin', menuorder=3 WHERE label='Colors' AND menu='admin';
UPDATE menus SET menu='adv-admin', menuorder=4 WHERE label='Filters' AND menu='admin';
UPDATE menus SET menu='adv-admin', menuorder=5 WHERE label='Sections' AND menu='admin';
UPDATE menus SET menu='adv-admin', menuorder=6 WHERE label='Users' AND menu='admin';
UPDATE menus SET menu='adv-admin', menuorder=7 WHERE label='Templates' AND menu='admin';
UPDATE menus SET menu='adv-admin', menuorder=8 WHERE label='Vars' AND menu='admin';
UPDATE menus SET menu='adv-admin', menuorder=9 WHERE label='Site' AND menu='admin';
UPDATE menus SET menuorder=9 WHERE label='Slashd' AND menu='admin';
UPDATE menus SET menuorder=10 WHERE label='Recent' AND menu='admin';
REPLACE INTO menus (menu, label, value, seclev, menuorder) values ('admin', 'Advanced', '[% gSkin.rootdir %]/topics.pl', 500, 11);
# none of these existed for me previously, so no rows were updated -- pudge
# That's fine. Only sites that updated in a brief window would have these -- jamie
# Change for plugins/Stats (ignore if not using that plugin)
UPDATE stats_daily SET name='m2_points_lost_spent' WHERE name='m2_points_spent';
UPDATE stats_daily SET name='mod_points_lost_spent' WHERE name='mod_points_spent';
UPDATE stats_daily SET name='mod_points_lost_spent_plus_1' WHERE name='mod_points_spent_plus_1';
UPDATE stats_daily SET name='mod_points_lost_spent_minus_1' WHERE name='mod_points_spent_minus_1';
ALTER TABLE users_info CHANGE people people MEDIUMBLOB;
# Do not run this on Slashdot, I have already done it for the DB that matters -Brian
ALTER TABLE accesslog DROP INDEX op_part;
ALTER TABLE accesslog ADD INDEX op_part (op, section);
# End of T_2_3_0_48, Start of T_2_3_0_49
UPDATE stats_daily SET name='mod_tokens_lost_stirred' WHERE name='mod_tokens_stirred';
# Do this next command with the value of the var "maxpoints" in place of "5"...
# UPDATE stats_daily SET value=value * 5 WHERE name='mod_tokens_lost_converted';
# End of T_2_3_0_49, Start of T_2_3_0_50
# (This change was actually made about a week ago, but the old var is
# supported in the code so this is not a vital var update.)
# For best results, replace "96" with 24 times the value of the var "stir":
INSERT INTO vars (name, value, description) VALUES ('mod_stir_hours','96','Number of hours before unused moderator points expire');
# and assuming a clean vars table is important to you:
DELETE FROM vars WHERE name='stir';
# split the 2 admin menus into 3
# adv-admin is now config
UPDATE menus SET label='Config', value='[% gSkin.rootdir %]/admin.pl?op=topics' WHERE label='Advanced';
UPDATE menus SET menu='info' WHERE label='Site' AND menu='adv-admin';
UPDATE menus SET menu='config' WHERE menu='adv-admin';
UPDATE menus SET menu='info' WHERE label='Recent';
UPDATE menus SET menu='info' WHERE label='Slashd';
REPLACE INTO menus (menu, label, value, seclev, menuorder) values ('admin', 'Info', '[% gSkin.rootdir %]/admin.pl?op=recent', 500, 12);
REPLACE INTO menus (menu, label, value, seclev, menuorder) values ('config', 'Normal', '[% gSkin.rootdir %]/admin.pl', 500, 9);
REPLACE INTO menus (menu, label, value, seclev, menuorder) values ('config', 'Info', '[% gSkin.rootdir %]/admin.pl?op=recent', 500, 10);
REPLACE INTO menus (menu, label, value, seclev, menuorder) values ('info', 'Normal', '[% gSkin.rootdir %]/admin.pl', 500, 12);
REPLACE INTO menus (menu, label, value, seclev, menuorder) values ('info', 'Config', '[% gSkin.rootdir %]/admin.pl?op=topics', 500, 13);
INSERT INTO vars (name, value, description) VALUES ('content_type_webpage','text/html','The Content-Type field for webpages');
# This needs to be set for all OSTG sites, and we should make sure that sites are using the right DB. -Brian
INSERT INTO vars (name, value, description) VALUES ('log_db_user','','The virtual user of the database that the code should write accesslog to. If you don\'t know what this is for, you should leave it blank.');
INSERT INTO vars (name, value, description) VALUES ('search_text_length','80','This will tell search how many characters should be returned for text bodies in searches (think introtext for stories and article for journals).');
INSERT INTO vars (name, value, description) VALUES ('search_method', '', 'Method to use to weight scores for search returns (and to narrow down possible matches)');
# End of T_2_3_0_50, Start of T_2_3_0_51
# If you installed your theme and plugins as symlinks, uncomment the first
# line. If not, uncomment the second. If a mix, pick one, and then go
# manually edit the text file generated to make it speak the truth about
# your site. In any case, then run the SOURCE line.
#SELECT CONCAT('INSERT INTO site_info (name, value, description) VALUES ("', name, '_', value, '_symlink", 1, "', value, ' ', name, ' files installed symlink?");') INTO OUTFILE '/tmp/site_symlinks' FROM site_info WHERE name IN ('theme', 'plugin') ORDER BY name;
#SELECT CONCAT('INSERT INTO site_info (name, value, description) VALUES ("', name, '_', value, '_symlink", 0, "', value, ' ', name, ' files installed symlink?");') INTO OUTFILE '/tmp/site_symlinks' FROM site_info WHERE name IN ('theme', 'plugin') ORDER BY name;
#SOURCE /tmp/site_symlinks;
# End of T_2_3_0_51, Start of T_2_3_0_52
ALTER TABLE menus ADD COLUMN sel_label VARCHAR(32) NOT NULL DEFAULT '' AFTER label, ADD COLUMN showanon TINYINT DEFAULT '0' NOT NULL AFTER seclev;
UPDATE menus SET showanon=1 WHERE seclev=0;
UPDATE menus SET sel_label=label;
DELETE FROM menus WHERE menu='users';
INSERT INTO menus (id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL, 'users', 'Logout', 'logout', '/my/logout', 1, 0, 10);
INSERT INTO menus (id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL, 'users', 'Preferences', 'preferences', '/users.pl?op=edituser', 1, 0, 20);
INSERT INTO menus (id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL, 'users', 'Password', 'password', '/login.pl?op=changeprefs', 1, 0, 40);
INSERT INTO menus (id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL, 'users', '[% user.nickname | strip_literal %]', 'me', '/~[% user.nickname | fixparam %]', 1, 0, 50);
# Change for plugins/Subscribe (ignore if not using that plugin)
INSERT INTO menus (id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL, 'users', 'Subscription', 'subscription', '/subscribe.pl', 1, 0, 30);
DELETE FROM vars WHERE name='commentsPerPoint';
# Due to a bug, the old "hide anonymous comments at -1" feature was
# never fully removed and replaced with people_bonus_anonymous.
# Any users who still have that set, move them to an appropriate
# value on the new system.
UPDATE users_param SET name='people_bonus_anonymous', value='-3' WHERE name='anon_comments' AND value='1';
DELETE FROM users_param WHERE name='anon_comments';
# BEFORE running this, if you have any existing tzcodes not in the defaults,
# you may wish to take note of them so you can re-add them appropriately.
DROP TABLE IF EXISTS dst;
CREATE TABLE dst (
region VARCHAR(32) NOT NULL,
selectable TINYINT DEFAULT 0 NOT NULL,
start_hour TINYINT NOT NULL,
start_wnum TINYINT NOT NULL,
start_wday TINYINT NOT NULL,
start_month TINYINT NOT NULL,
end_hour TINYINT NOT NULL,
end_wnum TINYINT NOT NULL,
end_wday TINYINT NOT NULL,
end_month TINYINT NOT NULL,
PRIMARY KEY (region)
) TYPE = myisam;
INSERT INTO dst (region, selectable, start_hour, start_wnum, start_wday, start_month, end_hour, end_wnum, end_wday, end_month) VALUES ('America', 1, 2, 1, 0, 3, 2, -1, 0, 9);
INSERT INTO dst (region, selectable, start_hour, start_wnum, start_wday, start_month, end_hour, end_wnum, end_wday, end_month) VALUES ('Europe', 1, 1, -1, 0, 2, 1, -1, 0, 9);
INSERT INTO dst (region, selectable, start_hour, start_wnum, start_wday, start_month, end_hour, end_wnum, end_wday, end_month) VALUES ('Australia', 1, 2, -1, 0, 9, 2, -1, 0, 2);
INSERT INTO dst (region, selectable, start_hour, start_wnum, start_wday, start_month, end_hour, end_wnum, end_wday, end_month) VALUES ('New Zealand', 0, 2, 1, 0, 9, 2, 3, 0, 2);
DROP TABLE IF EXISTS tzcodes;
CREATE TABLE tzcodes (
tz CHAR(4) NOT NULL,
off_set MEDIUMINT NOT NULL,
description VARCHAR(64),
dst_region VARCHAR(32),
dst_tz CHAR(4),
dst_off_set MEDIUMINT,
PRIMARY KEY (tz)
) TYPE = myisam;
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('UTC', 0, 'Universal Coordinated', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('IDLW', -43200, 'International Date Line West', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('IDLE', 43200, 'International Date Line East', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('GMT', 0, 'Greenwich Mean', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('WEST', 0, 'Western European', 'Europe', 'WEST', 3600);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('CEST', 3600, 'Central European', 'Europe', 'CEST', 7200);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('EEST', 7200, 'Eastern European', 'Europe', 'EEST', 10800);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('BT', 10800, 'Baghdad, USSR Zone 2', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('IT', 12600, 'Iran', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('ZP4', 14400, 'USSR Zone 3', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('ZP5', 18000, 'USSR Zone 4', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('IST', 19800, 'Indian', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('ZP6', 21600, 'USSR Zone 5', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('ZP7', 25200, 'USSR Zone 6', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('JT', 27000, 'Java', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('CCT', 28800, 'China Coast, USSR Zone 7', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('JST', 32400, 'Japan, USSR Zone 8', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('KST', 32400, 'Korean', NULL, 'KDT', 36000);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('AWST', 28800, 'Western Australian', 'Australia', 'AWDT', 32400);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('ACST', 34200, 'Central Australian', 'Australia', 'ACDT', 37800);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('AEST', 36000, 'Eastern Australian', 'Australia', 'AEDT', 39600);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('NZST', 43200, 'New Zealand', 'New Zealand', 'NZDT', 46800);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('WAT', -3600, 'West Africa', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('AT', -7200, 'Azores', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('GST', -10800, 'Greenland', NULL, NULL, NULL);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('NST', -12600, 'Newfoundland', 'America', 'NDT', -9000);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('AST', -14400, 'Atlantic', 'America', 'ADT', -10800);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('EST', -18000, 'Eastern', 'America', 'EDT', -14400);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('CST', -21600, 'Central', 'America', 'CDT', -18000);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('MST', -25200, 'Mountain', 'America', 'MDT', -21600);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('PST', -28800, 'Pacific', 'America', 'PDT', -25200);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('AKST', -32400, 'Alaska', 'America', 'AKDT', -28800);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('HAST', -36000, 'Hawaii-Aleutian', 'America', 'HADT', -32400);
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('NT', -39600, 'Nome', NULL, NULL, NULL);
# VERY IMPORTANT: run `utils/dst-update.plx VIRTUAL_USER` after running upgrades
# here, to convert the user timezones to the new timezones, plus to the new
# DST stuff.
# ALSO IMPORTANT: run `utils/colors-update.plx VIRTUAL_USER` too, to insert the
# new colors used for tabbed menus. If you've hacked the code to handle more
# fg/bg colors, you'll want to edit your templates to bump up by one everything
# from your numbers 5 on up. (But if you've hacked the code, you probably
# already saw a CVS conflict on Anchor.pm getSectionColors() and figured
# something was up. :)
UPDATE menus SET label=CONCAT('~', label, ' ([% user.uid %])') WHERE menu='users' AND sel_label='me';
# End of T_2_3_0_52, Start of T_2_3_0_53
ALTER TABLE moderatorlog ADD COLUMN spent tinyint DEFAULT '1' NOT NULL AFTER active;
INSERT INTO vars (name, value, description) VALUES ('charrefs_bad_entity','zwnj|zwj|lrm|rlm','Entities that approveCharref should always delete');
INSERT INTO vars (name, value, description) VALUES ('charrefs_bad_numeric','8204|8205|8206|8207|8236|8237|8238','Numeric references that approveCharref should always delete');
INSERT INTO vars (name, value, description) VALUES ('comment_compress_slice','500','Chars to slice comment into for compressOk');
INSERT INTO vars (name, value, description) VALUES ('comment_homepage_disp','50','Chars of poster URL to show in comment header');
INSERT INTO vars (name, value, description) VALUES ('mod_elig_hoursback','48','Hours back in accesslog to look for mod elig');
INSERT INTO vars (name, value, description) VALUES ('mod_elig_minkarma','0','The min M1 karma');
INSERT INTO vars (name, value, description) VALUES ('mod_up_points_needed','','Need more than 1 point to mod up? Hash');
INSERT INTO vars (name, value, description) VALUES ('m2_min_daysbackcushion','2','The minimum days-back cushion');
INSERT INTO vars (name, value, description) VALUES ('m2_mintokens','0','The min M2 tokens');
INSERT INTO vars (name, value, description) VALUES ('m2_range_offset','0.9','Offset for M2 assignment ranges');
# Change for plugins/Admin (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('uncommon_weight_bodytext','0.5','The min M1 karma');
INSERT INTO vars (name, value, description) VALUES ('uncommon_weight_introtext','1','The min M1 karma');
INSERT INTO vars (name, value, description) VALUES ('uncommon_weight_title','8','The min M1 karma');
# End of T_2_3_0_53, Start of T_2_3_0_54
# End of T_2_3_0_54, Start of T_2_3_0_55
# End of T_2_3_0_55, Start of T_2_3_0_56
# oops: make sure you restart httpds after this
UPDATE tzcodes SET tz = 'WET' WHERE tz = 'WEST';
UPDATE tzcodes SET tz = 'CET' WHERE tz = 'CEST';
UPDATE tzcodes SET tz = 'EET' WHERE tz = 'EEST';
UPDATE users_prefs SET tzcode = 'WET' WHERE tzcode = 'WEST';
UPDATE users_prefs SET tzcode = 'CET' WHERE tzcode = 'CEST';
UPDATE users_prefs SET tzcode = 'EET' WHERE tzcode = 'EEST';
# End of T_2_3_0_56, Start of T_2_3_0_57
ALTER TABLE people ADD index(person);
INSERT INTO vars (name, value, description) VALUES ('archive_delay_mod', '60', 'Days before moderator logs are expired');
INSERT INTO vars (name, value, description) VALUES ('mod_stir_recycle_fraction', '1.0', 'What fraction of unused mod points get recycled back into the system?');
INSERT INTO vars (name, value, description) VALUES ('m1_pointgrant_factor_stirratio', '1.1', 'Factor of stirred-points ratio in deciding who is eligible for moderation (1=irrelevant, 2=top user twice as likely)');
# End of T_2_3_0_57, Start of T_2_3_0_58
# Subsection stuff -Brian
DROP TABLE IF EXISTS section_subsections;
CREATE TABLE section_subsections (
section varchar(30) NOT NULL,
subsection smallint UNSIGNED NOT NULL,
FOREIGN KEY (section) REFERENCES sections(section),
FOREIGN KEY (subsection) REFERENCES subsections(subsection),
PRIMARY KEY (section,subsection)
) TYPE = myisam;
INSERT INTO section_subsections SELECT section, id from subsections;
ALTER TABLE subsections DROP section;
# Change for plugins/Subscribe (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('subscribe_email', 'admin@example.com', 'Email address for subscription-related issues');
ALTER TABLE related_links CHANGE name name VARCHAR(80);
# End of T_2_3_0_58, Start of T_2_3_0_59
ALTER TABLE comments ADD COLUMN pointsorig tinyint DEFAULT '0' NOT NULL AFTER points;
UPDATE comments SET pointsorig=points;
ALTER TABLE moderatorlog ADD COLUMN ipid char(32) DEFAULT '' NOT NULL AFTER id;
ALTER TABLE moderatorlog ADD COLUMN subnetid char(32) DEFAULT '' NOT NULL AFTER ipid;
ALTER TABLE modreasons ADD COLUMN unfairname varchar(32) DEFAULT '' NOT NULL;
UPDATE modreasons SET unfairname='Unfunny' WHERE name='Funny';
ALTER TABLE moderatorlog ADD INDEX ipid (ipid), ADD INDEX subnetid (subnetid);
ALTER TABLE sections ADD defaultdisplaystatus TINYINT DEFAULT '0' NOT NULL;
ALTER TABLE sections ADD defaultcommentstatus TINYINT DEFAULT '0' NOT NULL;
ALTER TABLE sections ADD defaulttopic TINYINT DEFAULT '1' NOT NULL;
ALTER TABLE sections ADD defaultsection VARCHAR(30); /* Only set in collected sections */
ALTER TABLE sections ADD defaultsubsection SMALLINT UNSIGNED DEFAULT 0 NOT NULL;
UPDATE sections SET defaultsubsection=section WHERE type != "collected";
# This only fixes it for default Slash sites
UPDATE sections SET defaultsection='articles' WHERE section='index';
# For Slashdot do the following, for any other site it will depend on the site:
# UPDATE sections SET defaulttopic=99;
ALTER TABLE sections DROP extras;
DELETE FROM templates WHERE section="admin";
# Change for plugins/Journal (ignore if not using that plugin)
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('journal','Edit Preferences','[% gSkin.rootdir %]/journal.pl?op=editprefs',1,4);
# End of T_2_3_0_59, Start of T_2_3_0_60
# End of T_2_3_0_60, Start of T_2_3_0_61
DROP TABLE IF EXISTS accesslog_admin;
CREATE TABLE accesslog_admin (
id int UNSIGNED NOT NULL auto_increment,
host_addr char(15) DEFAULT '' NOT NULL,
op varchar(254),
dat varchar(254),
uid mediumint UNSIGNED NOT NULL,
ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
query_string varchar(50),
user_agent varchar(50),
section varchar(30) DEFAULT 'index' NOT NULL,
bytes mediumint UNSIGNED DEFAULT 0 NOT NULL,
form MEDIUMBLOB NOT NULL,
INDEX host_addr (host_addr),
INDEX ts (ts),
PRIMARY KEY (id)
) TYPE = myisam;
# This was missed sometime in the past -Brian
INSERT INTO vars (name, value, description) VALUES ('delayed_inserts_off','1','This turns off delayed inserts (which you probably want to do)');
# You need to manually copy/symlink stats.pl from plugins/Stats into htdocs to use
# the new stats.pl program
# Set to email address(es) appropriate for your site, of course.
INSERT INTO vars (name, value, description) VALUES ('adminmail_post','admin@example.com','All admin mail about comment posting goes here');
# End of T_2_3_0_61, Start of T_2_3_0_62
# should be email-only
UPDATE message_codes SET modes = 0 WHERE code = 10;
# New Comment codes. Use them or... something -Brian
ALTER TABLE stories DROP commentstatus;
DELETE FROM code_param WHERE type="commentcodes";
DELETE FROM code_param WHERE type="journal_discuss";
INSERT INTO string_param (type, code, name) VALUES ('commentcodes','disabled','Comments Disabled');
INSERT INTO string_param (type, code, name) VALUES ('commentcodes','enabled','Comments Enabled');
INSERT INTO string_param (type, code, name) VALUES ('commentcodes_extended','friends_only','Just Friends');
INSERT INTO string_param (type, code, name) VALUES ('commentcodes_extended','friends_fof_only','Just Friends and their Friends');
INSERT INTO string_param (type, code, name) VALUES ('commentcodes_extended','no_foe','No Foes');
INSERT INTO string_param (type, code, name) VALUES ('commentcodes_extended','no_foe_eof','No Foes and No Friend\'s Foes');
# Only add the following if you want them. They are not to be installed on Slashdot yet. -Brian
#INSERT INTO code_param (type, code, name) VALUES ('commentcodes',4,'No Foes');
#INSERT INTO code_param (type, code, name) VALUES ('commentcodes',5,'No Foes and No Friend\'s Foes');
DELETE FROM vars WHERE name="article_nocomment";
ALTER TABLE discussions ADD commentstatus enum('disabled','enabled','friends_only','friends_fof_only','no_foe','no_foe_eof') DEFAULT 'enabled' NOT NULL;
ALTER TABLE sections DROP defaultcommentstatus;
ALTER TABLE sections ADD defaultcommentstatus enum('disabled','enabled','friends_only','friends_fof_only','no_foe','no_foe_eof') DEFAULT 'enabled' NOT NULL;
UPDATE sections SET defaultcommentstatus='enabled';
UPDATE vars SET value='enabled' WHERE name='defaultcommentstatus';
UPDATE users_param SET value = 'enabled' WHERE name = 'journal_discuss' AND value = "1";
UPDATE users_param SET value = 'disabled' WHERE name = 'journal_discuss' AND value = "0";
INSERT INTO vars (name, value, description) VALUES ('stats_sfnet_groupids','4421','List of sf.net group IDs to keep stats on');
# Change for plugins/Stats (ignore if not using that plugin)
UPDATE stats_daily SET name='mod_token_conversion_point' WHERE name='token_conversion_point';
ALTER TABLE accesslog_admin ADD COLUMN secure TINYINT UNSIGNED DEFAULT 0 NOT NULL;
# End of T_2_3_0_62, Start of T_2_3_0_63
# Do not blindly add this! -Brian
INSERT INTO blocks (bid, block, seclev, type, description, section, ordernum, title, portal, url, rdf, retrieve) VALUES ('friends_journal','',1,'portald','This adds a box where all of your friend\'s latest journal entries will be displayed.','index',5,'Friend\'s Journal Entries',1,NULL,NULL,0);
ALTER TABLE moderatorlog ADD INDEX uid (uid), ADD INDEX cuid (cuid);
ALTER TABLE accesslog ADD COLUMN duration FLOAT DEFAULT 0.0 NOT NULL, ADD COLUMN local_addr VARCHAR(16) DEFAULT '' NOT NULL;
# End of T_2_3_0_63, Start of T_2_3_0_64
# End of T_2_3_0_64, Start of T_2_3_0_65
# Change for plugins/Stats (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('stats_admin_seclev','100','seclev required to look at stats in stats.pl');
INSERT INTO vars (name, value, description) VALUES ('comments_more_seclev','100','Seclev required to see More Comments (special: 2 means subscribers)');
ALTER TABLE accesslog ADD static enum("yes","no") DEFAULT "yes";
ALTER TABLE accesslog ADD referer varchar(254);
ALTER TABLE moderatorlog ADD INDEX m2stat_act (m2status, active);
# End of T_2_3_0_65, Start of T_2_3_0_66
# End of T_2_3_0_66, Start of T_2_3_0_67
# this is not a DB command but needs to be done for
# each installed site:
# ln -s /usr/local/slash/themes/slashcode/tasks/delete_accesslog.pl /usr/local/slash/site/sitename/tasks/
ALTER TABLE accesslist ADD wasbanned tinyint unsigned DEFAULT 0 NOT NULL;
ALTER TABLE accesslist ADD wasreadonly tinyint unsigned DEFAULT 0 NOT NULL;
ALTER TABLE accesslist ADD INDEX isbanned (isbanned);
REPLACE INTO vars (name, value, description) VALUES ('allow_nonadmin_ssl','0','0=users with seclev <= 1 cannot access the site over Secure HTTP; 1=they all can; 2=only if they are subscribers');
INSERT INTO vars (name, value, description) VALUES ('m2_modlogid_min_old','0','Approximate min moderatorlog id');
INSERT INTO vars (name, value, description) VALUES ('m2_modlogid_max_old','0','Approximate max moderatorlog id that counts as old');
INSERT INTO vars (name, value, description) VALUES ('m2_modlogid_min_new','0','Approximate min moderatorlog id that counts as new');
INSERT INTO vars (name, value, description) VALUES ('m2_modlogid_max_new','0','Approximate max moderatorlog id');
INSERT INTO vars (name, value, description) VALUES ('lastlookmemory','3600','Amount of time the uid last looked-at will be remembered/displayed');
ALTER TABLE comments ADD karma_bonus enum('yes', 'no') DEFAULT 'no' NOT NULL;
# End of T_2_3_0_67, Start of T_2_3_0_68
# End of T_2_3_0_68, Start of T_2_3_0_69
INSERT INTO vars (name, value, description) VALUES ('comment_startword_workaround','1','Should breakHtml() insert kludgy HTML to work around an MSIE bug?');
# New Zoo stuff, run rebuildPeople after you install the latest code and apply these changes -Brian
ALTER TABLE people drop fof;
ALTER TABLE people drop eof;
ALTER TABLE people add last_update timestamp;
DROP TABLE IF EXISTS people_nthdegree;
CREATE TABLE people_nthdegree (
uid MEDIUMINT UNSIGNED NOT NULL, /* The person who owns the relationship */
person MEDIUMINT UNSIGNED NOT NULL, /* Who the relationship is against */
friend MEDIUMINT UNSIGNED NOT NULL, /* Which friend is responsible for the relationship */
type enum("fof","eof"),
last_update timestamp,
UNIQUE degree_of_separation (uid,person,friend),
INDEX (person),
INDEX (uid),
INDEX (friend)
) TYPE = Innodb;
INSERT INTO vars (name,value,description) VALUES ('zoo_timer',NOW(),'Last time the Zoo task ran.');
DROP TABLE IF EXISTS people_log;
INSERT INTO vars (name, value, description) VALUES ('mod_karma_bonus_max_downmods',2,'How many times can you downmod a comment without it losing its karma bonus? (bonus lost at value+1th downmod) (set very high to disable)');
ALTER TABLE message_drop ADD COLUMN send ENUM('now', 'defer', 'collective') DEFAULT 'now' NOT NULL;
INSERT INTO vars (name, value, description) VALUES ('message_last_deferred','','The last date that deferred messages were sent');
INSERT INTO vars (name, value, description) VALUES ('comments_mod_totals_exact','1','Show exact moderation counts?');
# End of T_2_3_0_69, Start of T_2_3_0_70
ALTER TABLE string_param MODIFY COLUMN type VARCHAR(32) NOT NULL;
UPDATE message_codes SET type = 'Comment Moderation' WHERE code = 3;
UPDATE message_codes SET type = 'Comment Reply' WHERE code = 4;
UPDATE message_codes SET type = 'Journal Reply' WHERE code = 7;
# FOUNDRIES LAST UPDATED
# Adds in the current bonus for those users who have it set -Brian
INSERT INTO users_param (uid, name, value) SELECT uid, "clbig_bonus", "+1" FROM users_comments WHERE clbig > 0;
INSERT INTO users_param (uid, name, value) SELECT uid, "clsmall_bonus", "-1" FROM users_comments WHERE clsmall > 0;
ALTER TABLE accesslist ADD isproxy enum("no","yes") DEFAULT "no" NOT NULL;
ALTER TABLE accesslog ADD secure TINYINT DEFAULT 0 NOT NULL;
# End of T_2_3_0_70, Start of T_2_3_0_71
INSERT INTO vars (name, value, description) VALUES ('accesslog_insert_cachesize','0','Cache accesslog inserts and do this many all at once (0 to disable, if enabled, suggest value of 5 or so)');
INSERT INTO vars (name, value, description) VALUES ('index_gse_backup_prob','0','Probability that index.pl getStoriesEssentials will look to backup_db_user instead of the main db: 0=never, 1=always');
INSERT INTO vars (name, value, description) VALUES ('selectcomm_backup_prob','0','Probability that Slash.pm selectComments will look to backup_db_user instead of the main db: 0=never, 1=always');
INSERT INTO vars (name, value, description) VALUES ('prepuser_backup_prob','0','Probability that Environment.pm prepareUser will look to backup_db_user instead of the main db: 0=never, 1=always');
# End of T_2_3_0_71, Start of T_2_3_0_72
# Doesn't have to be 250, pick whatever for your own site.
INSERT INTO vars (name, value, description) VALUES ('comment_commentlimit','250','Max commentlimit users can set');
UPDATE users_comments SET commentlimit=250 WHERE commentlimit > 250;
CREATE TABLE classes (
id mediumint UNSIGNED NOT NULL auto_increment,
class varchar(255) NOT NULL,
db_type enum("writer","reader","log","search") DEFAULT "writer" NOT NULL,
fallback enum("writer","reader","log","search"),
UNIQUE class_key (class),
PRIMARY KEY (id)
) TYPE = myisam;
CREATE TABLE dbs (
id mediumint UNSIGNED NOT NULL auto_increment,
virtual_user varchar(100) NOT NULL,
isalive enum("no","yes") DEFAULT "no" NOT NULL,
type enum("writer","reader","log","search") DEFAULT "reader" NOT NULL,
PRIMARY KEY (id)
) TYPE = myisam;
INSERT INTO vars (name, value, description) VALUES ('poll_fwdfor','1','Loose proxy management for voting?');
INSERT INTO vars (name, value, description) VALUES ('mailpass_max_hours','48','Mailing a password only allowed mailpass_max_num times per account per this many hours');
INSERT INTO vars (name, value, description) VALUES ('mailpass_max_num','2','Mailing a password only allowed this many times per account per mainpass_max_hours hours');
# Already applied to Slashdot
ALTER TABLE users_info ADD people_status ENUM ("ok","dirty") DEFAULT "ok" NOT NULL;
ALTER TABLE users_info ADD index people_status(people_status);
DROP TABLE people_nthdegree;
ALTER TABLE people DROP last_update;
ALTER TABLE stories ADD INDEX section (section);
ALTER TABLE stories DROP INDEX frontpage;
ALTER TABLE accesslog ADD status smallint UNSIGNED DEFAULT 200 NOT NULL;
ALTER TABLE accesslog_admin ADD status smallint UNSIGNED DEFAULT 200 NOT NULL;
ALTER TABLE topics ADD parent_topic smallint UNSIGNED DEFAULT 0 NOT NULL;
ALTER TABLE message_codes ADD COLUMN subscribe TINYINT(1) DEFAULT '0' NOT NULL;
ALTER TABLE message_codes ADD COLUMN send ENUM('now', 'defer', 'collective') DEFAULT 'now' NOT NULL;
UPDATE message_codes SET send = 'collective' WHERE code IN (2, 3);
INSERT INTO message_codes (code, type, seclev, modes, send, subscribe) VALUES (12, 'Relationship Change', 1, '', 'collective', 1);
# run `perl ./plugins/Messages/populate_message_log_stats.plx VIRTUAL_USER` to
# update the messaging stats in stats_daily, using the last several weeks
# of stats in message_log
# End of T_2_3_0_72, Start of T_2_3_0_73
# End of T_2_3_0_73, Start of T_2_3_0_74
UPDATE stats_daily SET name='subscribers_total' WHERE name='subscribe_subscribers_ever';
UPDATE stats_daily SET name='subscribers_current' WHERE name='subscribe_subscribers_current';
# Change for plugins/HumanConf (ignore if not using that plugin)
ALTER TABLE humanconf_pool ADD COLUMN created_at DATETIME NOT NULL AFTER lastused;
UPDATE humanconf_pool SET lastused=lastused, created_at=lastused WHERE lastused IS NOT NULL;
INSERT INTO vars (name, value, description) VALUES ('debug_maintable_border','0','Border on the main table (for debugging purposes)');
# This will change all users who have the pref set to get messages for all new comments
# (bug in users.pl:newUser()) to getting messages for comment replies. The pref was not
# used, because new users didn't have the seclev for it. On a very few
# sites (low-traffic ones, probably), some admins will have this preference
# set for themselves. You'll need to deal with those admin accounts by hand, if they exist.
#
# *** NOTE ***
# If you have entries in your DB that contain both 4 and 8 for the same UID, this will
# fail. So first run this:
# SELECT u1.id, u1.uid, u1.code, u1.mode FROM users_messages AS u1, users_messages AS u2 WHERE u1.uid = u2.uid AND u1.code = 8 AND u2.code = 4;
#
# Then by hand, add the returned IDs to this list, and run:
# DELETE FROM users_messages WHERE id IN ( ... );
#
# THEN, finally, run the code below. :-)
UPDATE users_messages SET code = 4 WHERE code = 8;
# End of T_2_3_0_74, Start of T_2_3_0_75
DROP TABLE IF EXISTS stats_graphs_index;
CREATE TABLE stats_graphs_index (
day DATE NOT NULL,
md5 VARCHAR(32) NOT NULL,
id BLOB DEFAULT ''
);
INSERT INTO vars (name, value, description) VALUES ('adminmail_last_run','2003-02-20','day adminmail last ran');
# End of T_2_3_0_75, Start of T_2_3_0_76
INSERT INTO vars (name, value, description) VALUES ('subscribe_future_secs','0','Seconds worth of stories that subscribers can see into The Mysterious Future');
INSERT INTO vars (name, value, description) VALUES ('subscribe_future_post','0','Can subscribers post to stories in The Mysterious Future?');
INSERT INTO vars (name, value, description) VALUES ('subscribe_future_name','in <B>The Mysterious Future!</B>','Name of the future that subscribers can see stories in');
# Change for plugins/Stats (ignore if not using that plugin)
ALTER TABLE stats_daily ADD INDEX name_day (name,day);
ALTER TABLE stats_daily CHANGE COLUMN name name VARCHAR(48);
UPDATE stats_daily SET name='mod_points_lost_spent_plus_1_percent' WHERE name='mod_points_lost_spent_plus_1_per';
UPDATE stats_daily SET name='mod_points_lost_spent_minus_1_percent' WHERE name='mod_points_lost_spent_minus_1_pe';
# End of T_2_3_0_76, Start of T_2_3_0_77
# End of T_2_3_0_77, Start of T_2_3_0_78
# First pass at updating accesslist to be simpler and smarter:
ALTER TABLE accesslist ADD COLUMN now SET('ban', 'nopost', 'nosubmit', 'norss', 'proxy') DEFAULT '' NOT NULL;
ALTER TABLE accesslist ADD COLUMN was SET('ban', 'nopost', 'nosubmit', 'norss', 'proxy') DEFAULT '' NOT NULL;
ALTER TABLE accesslist CHANGE COLUMN reason reason VARCHAR(255);
UPDATE accesslist SET now='nopost' WHERE readonly=1 AND formname='comments';
UPDATE accesslist SET was='nopost' WHERE wasreadonly=1 AND formname='comments';
UPDATE accesslist SET now=CONCAT(now, ',nosubmit') WHERE readonly=1 AND formname='submit';
UPDATE accesslist SET now=CONCAT(was, ',nosubmit') WHERE wasreadonly=1 AND formname='submit';
UPDATE accesslist SET now='nopost,nosubmit' WHERE readonly=1 AND (formname IS NULL OR formname = '');
UPDATE accesslist SET was='nopost,nosubmit' WHERE wasreadonly=1 AND (formname IS NULL OR formname = '');
UPDATE accesslist SET now='ban' WHERE isbanned=1;
UPDATE accesslist SET was='ban' WHERE wasbanned=1;
UPDATE accesslist SET now=CONCAT(now, ',proxy') WHERE isproxy='yes';
ALTER TABLE accesslist DROP COLUMN formname, DROP COLUMN readonly, DROP COLUMN wasreadonly, DROP COLUMN isbanned, DROP COLUMN wasbanned, DROP COLUMN isproxy;
ALTER TABLE accesslist ADD INDEX now_was (now,was);
UPDATE accesslist SET uid=0 WHERE uid IS NULL;
ALTER TABLE accesslist CHANGE COLUMN uid uid MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
# Second pass at updating accesslist (apply these changes after applying
# the above changes, just like you'd expect):
ALTER TABLE accesslist ADD COLUMN now_ban ENUM("no", "yes") NOT NULL DEFAULT "no", ADD COLUMN now_nopost ENUM("no", "yes") NOT NULL DEFAULT "no", ADD COLUMN now_nosubmit ENUM("no", "yes") NOT NULL DEFAULT "no", ADD COLUMN now_norss ENUM("no", "yes") NOT NULL DEFAULT "no", ADD COLUMN now_proxy ENUM("no", "yes") NOT NULL DEFAULT "no", ADD COLUMN was_ban ENUM("no", "yes") NOT NULL DEFAULT "no", ADD COLUMN was_nopost ENUM("no", "yes") NOT NULL DEFAULT "no", ADD COLUMN was_nosubmit ENUM("no", "yes") NOT NULL DEFAULT "no", ADD COLUMN was_norss ENUM("no", "yes") NOT NULL DEFAULT "no", ADD COLUMN was_proxy ENUM("no", "yes") NOT NULL DEFAULT "no";
UPDATE accesslist SET now_ban ='yes' WHERE FIND_IN_SET('ban', now);
UPDATE accesslist SET now_nopost ='yes' WHERE FIND_IN_SET('nopost', now);
UPDATE accesslist SET now_nosubmit='yes' WHERE FIND_IN_SET('nosubmit', now);
UPDATE accesslist SET now_norss ='yes' WHERE FIND_IN_SET('norss', now);
UPDATE accesslist SET now_proxy ='yes' WHERE FIND_IN_SET('proxy', now);
UPDATE accesslist SET was_ban ='yes' WHERE FIND_IN_SET('ban', was);
UPDATE accesslist SET was_nopost ='yes' WHERE FIND_IN_SET('nopost', was);
UPDATE accesslist SET was_nosubmit='yes' WHERE FIND_IN_SET('nosubmit', was);
UPDATE accesslist SET was_norss ='yes' WHERE FIND_IN_SET('norss', was);
UPDATE accesslist SET was_proxy ='yes' WHERE FIND_IN_SET('proxy', was);
ALTER TABLE accesslist ADD INDEX now_ban (now_ban), ADD INDEX now_nopost (now_nopost), ADD INDEX now_nosubmit (now_nosubmit), ADD INDEX now_norss (now_norss), ADD INDEX now_proxy (now_proxy);
ALTER TABLE accesslist DROP COLUMN now, DROP COLUMN was;
UPDATE accesslist SET reason="" WHERE reason IS NULL;
ALTER TABLE accesslist CHANGE COLUMN reason reason VARCHAR(255) NOT NULL DEFAULT "";
# only insert this if you don't already have the value set in vars
#INSERT INTO vars (name, value, description) VALUES ('default_rss_template','default','name of default rss template used by portald');
# End of T_2_3_0_78, Start of T_2_3_0_79
INSERT INTO vars (name, value, description) VALUES ('use_prev_next_link','1','Boolean where to use next/prev links for articles');
INSERT INTO vars (name, value, description) VALUES ('accesslog_disable','0','Disable apache writing to accesslog?');
ALTER TABLE comments ADD COLUMN len SMALLINT UNSIGNED NOT NULL DEFAULT '0';
SELECT CONCAT("UPDATE comments SET len=", LENGTH(comment), " WHERE cid=", cid, ";") INTO OUTFILE "/tmp/comlen" FROM comment_text;
SOURCE /tmp/comlen;
# Change for plugins/Blob (ignore if not using that plugin)
DROP TABLE IF EXISTS story_files;
CREATE TABLE IF NOT EXISTS story_files (
id int(5) NOT NULL auto_increment,
sid varchar(16) NOT NULL default '',
description varchar(80) NOT NULL default '',
file_id varchar(32) NOT NULL default '',
isimage enum("yes","no") DEFAULT "no" NOT NULL,
INDEX sid_index (sid),
INDEX file_id_index (file_id),
PRIMARY KEY (id)
) TYPE = myisam;
# End of T_2_3_0_79, Start of T_2_3_0_80
ALTER TABLE dbs CHANGE type type ENUM("writer","reader","log","search","log_slave") DEFAULT "reader" NOT NULL;
ALTER TABLE classes CHANGE db_type db_type ENUM("writer","reader","log","search","log_slave") DEFAULT "writer" NOT NULL, CHANGE fallback fallback ENUM("writer","reader","log","search","log_slave") DEFAULT NULL;
# Change for plugins/Stats (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('adminmail_last_run','2003-03-19','day adminmail last ran');
# End of T_2_3_0_80, Start of T_2_3_0_81
ALTER TABLE accesslist ADD COLUMN adminuid mediumint(8) unsigned NOT NULL default '0' AFTER id;
# CHANGE THIS TO YOUR OWN ADMIN EMAIL ADDRESS
#INSERT INTO vars (name, value, description) VALUES ('adminmail_ban','admin@example.com','All admin mail about users being banned goes here');
# End of T_2_3_0_81, Start of T_2_3_0_82
# End of T_2_3_0_82, Start of T_2_3_0_83
# End of T_2_3_0_83, Start of T_2_3_0_84
# the 'what's playing' slashbox
INSERT INTO vars (name, value, description) VALUES ('slashbox_whatsplaying','0','Whether or not to turn on the "What\'s Playing" Slashbox.');
ALTER TABLE accesslist ADD COLUMN now_trusted ENUM("no", "yes") NOT NULL DEFAULT "no" AFTER now_proxy, ADD COLUMN was_trusted ENUM("no", "yes") NOT NULL DEFAULT "no" AFTER was_proxy;
ALTER TABLE accesslist ADD INDEX now_trusted (now_trusted);
# End of T_2_3_0_84, Start of T_2_3_0_85 - 2003/04/10
# End of T_2_3_0_85, Start of T_2_3_0_86 - 2003/04/10
# End of T_2_3_0_86, Start of T_2_3_0_87 - 2003/04/16
# End of T_2_3_0_87, Start of T_2_3_0_88 - 2003/04/16
ALTER TABLE story_topics ADD is_parent ENUM("no", "yes") DEFAULT 'no' NOT NULL;
# Currently all stories will be this case
UPDATE story_topics SET is_parent="no";
# New topic image stuff
DROP TABLE IF EXISTS topic_image_sections;
CREATE TABLE topic_image_sections (
tid smallint UNSIGNED DEFAULT 0 NOT NULL,
topic_image mediumint UNSIGNED DEFAULT 0 NOT NULL,
section varchar(30) DEFAULT 'index' NOT NULL,
PRIMARY KEY (tid,section)
) TYPE = myisam;
DROP TABLE IF EXISTS topic_images;
CREATE TABLE topic_images (
id mediumint UNSIGNED NOT NULL auto_increment,
name varchar(100) NOT NULL,
image varchar(100),
width smallint UNSIGNED,
height smallint UNSIGNED,
PRIMARY KEY (id)
) TYPE = myisam;
INSERT INTO topic_images SELECT "", name,image,width,height FROM topics;
ALTER TABLE topics ADD default_image mediumint UNSIGNED DEFAULT 0 NOT NULL;
# You must pick one of the following two options. Actually, running them
# both won't hurt anything, but just pick one or the other, OK?
# If your main DB is running MySQL 4.x, you can use this line.
# UPDATE topics,topic_images SET default_image=topic_images.id WHERE topic_images.name=topics.name;
# If your main DB is running MySQL 3.x, you must use these lines.
# SELECT CONCAT("UPDATE topics SET default_image=", topic_images.id, " WHERE name='", topics.name, "';") INTO OUTFILE "/tmp/topicsimages" FROM topics, topic_images WHERE topics.name = topic_images.name;
# SOURCE "/tmp/topicsimages";
ALTER TABLE topics DROP width;
ALTER TABLE topics DROP height;
ALTER TABLE topics DROP image;
# Change for plugins/Subscribe (ignore if not using that plugin)
ALTER TABLE comments ADD COLUMN subscriber_bonus ENUM("no", "yes") NOT NULL DEFAULT "no" AFTER karma_bonus;
#
# Table structure for table 'users_acl'
#
DROP TABLE IF EXISTS users_acl;
CREATE TABLE users_acl (
id mediumint UNSIGNED NOT NULL auto_increment,
uid mediumint UNSIGNED NOT NULL,
acl varchar(32) NOT NULL,
UNIQUE uid_key (uid,acl),
KEY uid (uid),
PRIMARY KEY (id)
) TYPE = MyISAM;
# End of T_2_3_0_88, Start of T_2_3_0_89 - 2003/04/23
# End of T_2_3_0_89, Start of T_2_3_0_90 - 2003/04/24
INSERT INTO vars (name, value, description) VALUES ('subscribe_future_plug','0','If subscribe_future_secs > 0, do non-subscribers get to know when a future story is coming up, even though they cannot see it?');
# End of T_2_3_0_90, Start of T_2_3_0_91 - 2003/04/25
# End of T_2_3_0_91, Start of T_2_3_0_92 - 2003/04/25
# End of T_2_3_0_92, Start of T_2_3_0_93 - 2003/04/30
# End of T_2_3_0_93, Start of T_2_3_0_94 - 2003/05/08
INSERT INTO menus (menu, label, sel_label, value, seclev, menuorder) VALUES ('info','Stats','Stats','[% gSkin.rootdir %]/stats.pl',1,2);
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('stats', 'Reports', '[% gSkin.rootdir %]/stats.pl?op=report', 1, 1);
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('stats', 'Graphs', '[% gSkin.rootdir %]/stats.pl?op=list&amp;type=graphs', 1, 2);
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('stats', 'Dumps', '[% gSkin.rootdir %]/stats.pl?op=list', 1, 3);
# Change for plugins/Subscribe (ignore if not using that plugin)
ALTER TABLE subscribe_payments ADD COLUMN memo VARCHAR(255) NOT NULL AFTER method;
# End of T_2_3_0_94, Start of T_2_3_0_95 - 2003/05/13
# End of T_2_3_0_95, Start of T_2_3_0_96 - 2003/05/13
ALTER TABLE stories ADD body_length MEDIUMINT UNSIGNED DEFAULT 0 NOT NULL, ADD word_count MEDIUMINT UNSIGNED DEFAULT 0 NOT NULL;
# You must pick one of the following two options. Actually, running them
# both won't hurt anything, but just pick one or the other, OK?
# If your main DB is running MySQL 4.x, you can use this line.
# UPDATE stories,story_text SET body_length=length(bodytext) WHERE stories.sid=story_text.sid;
# If your main DB is running MySQL 3.x, you must use these lines.
#SELECT CONCAT("UPDATE stories SET body_length=", length(bodytext), " WHERE sid='", sid, "';") INTO OUTFILE "/tmp/storieslength" FROM story_text WHERE length(bodytext) > 0;
#SOURCE /tmp/storieslength;
# And now that that's done... honestly, something should go here to set word_count
INSERT INTO vars (name, value, description) VALUES ('cache_enabled_template','1','If set, then template caching is still active even if var cache_enabled is turned off.');
INSERT INTO vars (name, value, description) VALUES ('debug_db_cache','0','If set, then write debug info for the Slash::DB cache to STDERR');
ALTER TABLE accesslist ADD COLUMN now_nopalm ENUM("no", "yes") NOT NULL DEFAULT "no" AFTER now_norss, ADD COLUMN was_nopalm ENUM("no", "yes") NOT NULL DEFAULT "no" AFTER was_norss;
ALTER TABLE accesslist ADD INDEX now_nopalm (now_nopalm);
# End of T_2_3_0_96, Start of T_2_3_0_97 - 2003/05/20
# We recommend that _97 not be used, it seems to have story caching bugs.
# If you're tracking T_ tags closely, you're living on the edge. :)
# Stick with _96 or before for now. - Jamie 2003/05/30
ALTER TABLE story_text ADD rendered text;
# End of T_2_3_0_97, Start of T_2_3_0_98 - 2003/05/28
# do this if you want to use UTF-8, which is recommended ... else don't do this, or
# use the charset you want
REPLACE INTO vars (name, value, description) VALUES ('content_type_webpage','text/html; charset=utf-8','The Content-Type header for webpages');
ALTER TABLE modreasons ADD COLUMN karma TINYINT NOT NULL DEFAULT '0' AFTER val;
UPDATE modreasons SET karma=val;
# End of T_2_3_0_98, Start of T_2_3_0_99 - 2003/06/03
# End of T_2_3_0_99, Start of T_2_3_0_100 - 2003/06/05
# End of T_2_3_0_100, Start of T_2_3_0_101 - 2003/06/12
# This index won't work on InnoDB tables but that's OK; it doesn't
# make much of a performance difference anyway. If you are running
# replicated DBs and your master DB is Inno, then run this on any
# slave DBs which are MyISAM (for example, a search db which has the
# other FULLTEXT indexes on this table). In any case, if this
# throws an error, you can ignore it.
ALTER TABLE story_text ADD INDEX rendered (rendered(1));
# If you have MySQL 4.x, do the next line. If you're still on 3.x,
# figure it out yourself, we don't have a line for that :)
# UPDATE stories,story_text SET writestatus='dirty', rendered=NULL WHERE stories.sid=story_text.sid AND stories.writestatus IN ('ok', 'dirty') AND time >= '2003-05-15 00:00:00';
INSERT INTO vars (name, value, description) VALUES ('freshen_homepage_min_minutes','60','Number of minutes between updating the main index.shtml homepage (if 0, disabled, only updates when freshenup.pl believes it is required)');
# End of T_2_3_0_101, Start of T_2_3_0_102 - 2003/06/18
ALTER TABLE rss_raw ADD INDEX processed (processed);
# This should have been done a while ago... if you ran a build
# from mid-March for a while, you might have ended up with
# duplicate sid,tid rows in story_topics. This will remove
# those rows. If you didn't, this is harmless. As usual with
# OUTFILE/SOURCE, if you have multiple sites, pick a different
# filename for each one, and if speed is a concern, try the
# command line "mysql dbname < /tmp/foo" instead.
SELECT CONCAT("DELETE FROM story_topics WHERE id='", st1.id, "';") INTO OUTFILE "/tmp/del-extra-story-topics.sql" FROM story_topics AS st1, story_topics AS st2 WHERE st1.sid=st2.sid AND st1.tid=st2.tid AND st1.id < st2.id;
SOURCE /tmp/del-extra-story-topics.sql;
ALTER TABLE story_topics ADD UNIQUE sid_tid (sid,tid);
INSERT IGNORE INTO story_topics SELECT "", sid, tid, "no" FROM stories;
ALTER TABLE story_topics DROP INDEX sid_tid;
CREATE TABLE IF NOT EXISTS soap_methods (
id MEDIUMINT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
class VARCHAR(100) NOT NULL,
method VARCHAR(100) NOT NULL,
seclev MEDIUMINT DEFAULT 1000 NOT NULL,
subscriber_only TINYINT DEFAULT 0 NOT NULL,
formkeys VARCHAR(255) DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE soap_method(class, method)
);
# End of T_2_3_0_102, Start of T_2_3_0_103 - 2003/06/25
INSERT INTO vars (name, value, description) VALUES ('index_handler_noanon','home','The shtml page to call if a user is anon and index_noanon is set');
INSERT INTO vars (name, value, description) VALUES ('index_noanon','0','Redirect all anonymous users to index_handler_noanon instead of index.shtml. Set to 1 to activate, 0 to remove.');
INSERT INTO vars (name, value, description) VALUES ('nick_chars', ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$_.+!*\'(),-', 'Characters allowed in user nicknames');
INSERT INTO vars (name, value, description) VALUES ('nick_maxlen', '20', 'Max length of nickname, should correspond with schema for users.nickname');
# The great Inno'ing! You don't have to do this if you don't want to.
# It will probably help performance. Tables that use features that
# are not supported by Inno (FULLTEXT indexes) are left as MyISAM:
# comments, comment_text, journals, journals_text, pollquestions,
# stories, story_text, submissions, users, and also users_count.
# if you have a separate, slaved, search DB where those indexes are
# used, feel free to go TYPE=InnoDB on your other DB(s) and just
# leave the search DB as MyISAM.
ALTER TABLE abusers TYPE=InnoDB;
ALTER TABLE accesslist TYPE=InnoDB;
ALTER TABLE accesslog TYPE=InnoDB;
ALTER TABLE accesslog_admin TYPE=InnoDB;
ALTER TABLE authors_cache TYPE=InnoDB;
ALTER TABLE backup_blocks TYPE=InnoDB;
ALTER TABLE blocks TYPE=InnoDB;
ALTER TABLE classes TYPE=InnoDB;
ALTER TABLE code_param TYPE=InnoDB;
ALTER TABLE commentmodes TYPE=InnoDB;
ALTER TABLE content_filters TYPE=InnoDB;
ALTER TABLE dateformats TYPE=InnoDB;
ALTER TABLE dbs TYPE=InnoDB;
ALTER TABLE discussions TYPE=InnoDB;
ALTER TABLE dst TYPE=InnoDB;
ALTER TABLE formkeys TYPE=InnoDB;
ALTER TABLE hooks TYPE=InnoDB;
ALTER TABLE menus TYPE=InnoDB;
ALTER TABLE metamodlog TYPE=InnoDB;
ALTER TABLE misc_user_opts TYPE=InnoDB;
ALTER TABLE moderatorlog TYPE=InnoDB;
ALTER TABLE modreasons TYPE=InnoDB;
ALTER TABLE pollanswers TYPE=InnoDB;
ALTER TABLE pollvoters TYPE=InnoDB;
ALTER TABLE rss_raw TYPE=InnoDB;
ALTER TABLE related_links TYPE=InnoDB;
ALTER TABLE sections TYPE=InnoDB;
ALTER TABLE sections_contained TYPE=InnoDB;
ALTER TABLE section_extras TYPE=InnoDB;
ALTER TABLE section_subsections TYPE=InnoDB;
ALTER TABLE section_topics TYPE=InnoDB;
ALTER TABLE soap_methods TYPE=InnoDB;
ALTER TABLE subsections TYPE=InnoDB;
ALTER TABLE sessions TYPE=InnoDB;
ALTER TABLE site_info TYPE=InnoDB;
ALTER TABLE slashd_status TYPE=InnoDB;
ALTER TABLE spamarmors TYPE=InnoDB;
ALTER TABLE story_param TYPE=InnoDB;
ALTER TABLE story_topics TYPE=InnoDB;
ALTER TABLE string_param TYPE=InnoDB;
ALTER TABLE submission_param TYPE=InnoDB;
ALTER TABLE templates TYPE=InnoDB;
ALTER TABLE topics TYPE=InnoDB;
ALTER TABLE topic_image_sections TYPE=InnoDB;
ALTER TABLE topic_images TYPE=InnoDB;
ALTER TABLE tzcodes TYPE=InnoDB;
ALTER TABLE users_acl TYPE=InnoDB;
ALTER TABLE users_comments TYPE=InnoDB;
ALTER TABLE users_hits TYPE=InnoDB;
ALTER TABLE users_index TYPE=InnoDB;
ALTER TABLE users_info TYPE=InnoDB;
ALTER TABLE users_param TYPE=InnoDB;
ALTER TABLE users_prefs TYPE=InnoDB;
ALTER TABLE vars TYPE=InnoDB;
# plugins/Blob (ignore if not using that plugin)
ALTER TABLE blobs TYPE=InnoDB;
ALTER TABLE story_files TYPE=InnoDB;
# plugins/Email (ignore if not using that plugin)
ALTER TABLE email_optout TYPE=InnoDB;
# plugins/Events (ignore if not using that plugin)
ALTER TABLE event_dates TYPE=InnoDB;
# plugins/HumanConf (ignore if not using that plugin)
ALTER TABLE humanconf TYPE=InnoDB;
ALTER TABLE humanconf_pool TYPE=InnoDB;
ALTER TABLE humanconf_questions TYPE=InnoDB;
# plugins/Journal (ignore if not using that plugin)
ALTER TABLE journal_themes TYPE=InnoDB;
# plugins/Messages (ignore if not using that plugin)
ALTER TABLE message_codes TYPE=InnoDB;
ALTER TABLE message_drop TYPE=InnoDB;
ALTER TABLE message_log TYPE=InnoDB;
ALTER TABLE message_web TYPE=InnoDB;
ALTER TABLE message_web_text TYPE=InnoDB;
ALTER TABLE users_messages TYPE=InnoDB;
# plugins/NewsVac (ignore if not using that plugin)
ALTER TABLE miner TYPE=InnoDB;
ALTER TABLE newsvac_keywords TYPE=InnoDB;
ALTER TABLE nugget_sub TYPE=InnoDB;
ALTER TABLE rel TYPE=InnoDB;
ALTER TABLE robosubmitlock TYPE=InnoDB;
ALTER TABLE spider TYPE=InnoDB;
ALTER TABLE spiderlock TYPE=InnoDB;
ALTER TABLE spider_timespec TYPE=InnoDB;
ALTER TABLE url_analysis TYPE=InnoDB;
ALTER TABLE url_content TYPE=InnoDB;
ALTER TABLE url_info TYPE=InnoDB;
ALTER TABLE url_message_body TYPE=InnoDB;
ALTER TABLE url_plaintext TYPE=InnoDB;
# plugins/PollBooth (ignore if not using that plugin)
ALTER TABLE auto_poll TYPE=InnoDB;
# plugins/Relocate (ignore if not using that plugin)
ALTER TABLE links_for_stories TYPE=InnoDB;
# plugins/Stats (ignore if not using that plugin)
ALTER TABLE stats_daily TYPE=InnoDB;
ALTER TABLE stats_graphs_index TYPE=InnoDB;
# plugins/Stock (ignore if not using that plugin)
ALTER TABLE stocks TYPE=InnoDB;
# plugins/Subscribe (ignore if not using that plugin)
ALTER TABLE subscribe_payments TYPE=InnoDB;
# plugins/YASS (ignore if not using that plugin)
ALTER TABLE yass_sites TYPE=InnoDB;
# plugins/Zoo (ignore if not using that plugin)
ALTER TABLE people TYPE=InnoDB;
# End of T_2_3_0_103, Start of T_2_3_0_104 - 2003/07/01
DELETE FROM menus WHERE menu="topics" AND label="Recent Topics";
INSERT INTO menus(id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL,'topics','Topic Hierarchy','','[% gSkin.rootdir %]/topics.pl?op=hierarchy ',0,1,1);
# End of T_2_3_0_104, Start of T_2_3_0_105 - 2003/07/09
INSERT INTO vars (name, value, description) VALUES ('no_prerendered_stories','0','Turn off use of prerendered stories in display');
ALTER TABLE users_index CHANGE COLUMN extid extid text;
# added the following to allow for date released polls. "nodisplay" polltype currently not-used
# but will likely be soon defaults to set all polls to be section polls -- you'll want to make
# sure this is set correctly for all polls currently showing, and it's probably best to update
# old ones which are story based to the correct type
ALTER TABLE pollquestions ADD COLUMN polltype ENUM("nodisplay", "section", "story") DEFAULT 'section';
# some sql to help fix old question polls-- if you're using MySQL 4.0.2 or higher and have
# multi-table updates:
#
# update pollquestions,stories set pollquestions.polltype='story' where pollquestions.qid=stories.qid;
#
# otherwise:
# select qid from stories where qid is not null;
# followed by the statement below--you'll have to fill in the qids yourself
# update pollquestions set polltype='story' where qid in( qids from previous query )
# memcached, see http://www.danga.com/memcached/
INSERT INTO vars (name, value, description) VALUES ('default_maxcommentsize','4096','Default user pref value, if you change the schema default for users_comments.maxcommentsize, change this too');
INSERT INTO vars (name, value, description) VALUES ('memcached','0','Use memcached?');
INSERT INTO vars (name, value, description) VALUES ('memcached_debug','0','Turn on debugging for memcached?');
INSERT INTO vars (name, value, description) VALUES ('memcached_keyprefix','x','Unique, short (1-2 chars probably) prefix to distinguish this site from the other sites sharing memcaches');
INSERT INTO vars (name, value, description) VALUES ('memcached_servers','127.0.0.1:11211','Space-sep list of servers for memcached in host:port format; to weight a server append =n');
# End of T_2_3_0_105, Start of T_2_3_0_106 - 2003/07/15
# End of T_2_3_0_107, Start of T_2_3_0_108 - 2003/07/15
INSERT INTO vars (name, value, description) VALUES ('counthits_lastmaxid','1','Last accesslog id scanned by counthits task');
# End of T_2_3_0_108, Start of T_2_3_0_109 - 2003/07/17
ALTER TABLE dbs CHANGE type type ENUM("writer","reader","log","search","log_slave","querylog") DEFAULT "reader" NOT NULL;
# If you want to do your querylogging to a separate DB, create an entry
# in the DBIx/Password.pm file, drop a row for it into the dbs table,
# and do the CREATE TABLE on that DB.
# INSERT INTO dbs (virtual_user, isalive, type) VALUES ('queryloguser', 'yes', 'querylog');
DROP TABLE IF EXISTS querylog;
CREATE TABLE querylog (
id int UNSIGNED NOT NULL auto_increment,
type enum('SELECT','INSERT','UPDATE','DELETE','REPLACE') NOT NULL DEFAULT 'SELECT',
thetables varchar(40) NOT NULL DEFAULT '',
ts timestamp NOT NULL,
package varchar(24) NOT NULL DEFAULT '',
line mediumint UNSIGNED NOT NULL DEFAULT '0',
package1 varchar(24) NOT NULL DEFAULT '',
line1 mediumint UNSIGNED NOT NULL DEFAULT '0',
duration float NOT NULL DEFAULT '0',
PRIMARY KEY (id),
KEY caller (package, line),
KEY ts (ts),
KEY type (type)
) TYPE=InnoDB;
UPDATE sections SET last_update='20000101000000' WHERE last_update IS NULL;
ALTER TABLE sections CHANGE COLUMN last_update last_update TIMESTAMP DEFAULT '20000101000000' NOT NULL;
UPDATE sections SET defaultsubsection='0' WHERE defaultsubsection IS NULL;
ALTER TABLE sections CHANGE COLUMN defaultsubsection defaultsubsection SMALLINT UNSIGNED DEFAULT '0' NOT NULL;
ALTER TABLE discussions CHANGE topic topic smallint UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE discussions ADD INDEX topic (topic);
#ALTER TABLE discussions ADD FOREIGN KEY (topic) REFERENCES topics(tid);
ALTER TABLE metamodlog CHANGE COLUMN mmid mmid INT UNSIGNED DEFAULT '0' NOT NULL;
ALTER TABLE metamodlog ADD FOREIGN KEY (mmid) REFERENCES moderatorlog(id);
# plugins/Messages (ignore if not using that plugin)
ALTER TABLE message_drop CHANGE COLUMN user user MEDIUMINT UNSIGNED NOT NULL, CHANGE COLUMN fuser fuser MEDIUMINT UNSIGNED NOT NULL;
ALTER TABLE message_log CHANGE COLUMN user user MEDIUMINT UNSIGNED NOT NULL, CHANGE COLUMN fuser fuser MEDIUMINT UNSIGNED NOT NULL;
ALTER TABLE message_web CHANGE COLUMN user user MEDIUMINT UNSIGNED NOT NULL, CHANGE COLUMN fuser fuser MEDIUMINT UNSIGNED NOT NULL;
ALTER TABLE users_messages CHANGE COLUMN uid uid MEDIUMINT UNSIGNED NOT NULL;
#ALTER TABLE users_messages ADD FOREIGN KEY (uid) REFERENCES users(uid);
# plugins/Journal (ignore if not using that plugin)
ALTER TABLE journals CHANGE COLUMN tid tid SMALLINT UNSIGNED NOT NULL;
# plugins/Events (ignore if not using that plugin)
ALTER TABLE event_dates CHANGE COLUMN sid sid varchar(16) NOT NULL DEFAULT '', ADD INDEX sid (sid);
# End of T_2_3_0_109, Start of T_2_3_0_110 - 2003/07/17
# End of T_2_3_0_110, Start of T_2_3_0_111 - 2003/07/23
# We set these to '1' for Slashdot.
INSERT INTO vars (name, value, description) VALUES ('draconian_charset','0','Convert high-bit characters to character references, which are then filtered by approveCharrefs or encode_html_amp (works only with Latin-1 for now)');
INSERT INTO vars (name, value, description) VALUES ('draconian_charset_convert','0','Convert some of high-bit chars to ASCII representations instead (see draconian_charset)');
# End of T_2_3_0_111, Start of T_2_3_0_112 - 2003/07/30
# selection choices for comment bytelimits
INSERT INTO code_param (type, code, name) VALUES ('bytelimit', 0, '128K');
INSERT INTO code_param (type, code, name) VALUES ('bytelimit', 1, '256K');
INSERT INTO code_param (type, code, name) VALUES ('bytelimit', 2, '384K');
INSERT INTO code_param (type, code, name) VALUES ('bytelimit', 3, '512K');
INSERT INTO code_param (type, code, name) VALUES ('bytelimit', 4, '640K');
INSERT INTO code_param (type, code, name) VALUES ('bytelimit', 5, '768K');
INSERT INTO code_param (type, code, name) VALUES ('bytelimit_sub', 6, '896K');
INSERT INTO code_param (type, code, name) VALUES ('bytelimit_sub', 7, '1024K');
INSERT INTO vars (name, value, description) VALUES ('defaultbytelimit', 5, 'The default setting for comment bytelimit');
# End of T_2_3_0_112, Start of T_2_3_0_113 - 2003/08/06
UPDATE users_comments SET mode='thread' WHERE mode IS NULL OR mode NOT IN ('flat', 'nested', 'nocomment', 'thread');
UPDATE users_comments SET threshold=0 WHERE threshold IS NULL;
UPDATE users_comments SET commentsort=0 WHERE commentsort IS NULL;
ALTER TABLE users_comments CHANGE COLUMN mode mode ENUM('flat', 'nested', 'nocomment', 'thread') DEFAULT 'thread' NOT NULL, CHANGE COLUMN commentsort commentsort TINYINT DEFAULT '0' NOT NULL, CHANGE COLUMN threshold threshold TINYINT DEFAULT '0' NOT NULL;
INSERT INTO tzcodes (tz, off_set, description, dst_region, dst_tz, dst_off_set) VALUES ('MAGS', 39600, 'Magadan', NULL, 'MAGD', 43200);
# sigh ... this really needs to be iso-8859-1 ... make it utf-8 if you want
# make sure you also put the right thing in your Apache confs for something like:
# AddType text/html;charset=iso-8859-1 .shtml
# -- pudge
REPLACE INTO vars (name, value, description) VALUES ('content_type_webpage','text/html; charset=iso-8859-1','The Content-Type header for webpages');
# End of T_2_3_0_113, Start of T_2_3_0_114 - 2003/08/12
# run this unless you have a reason not to (like, you have your own html-header;index)
DELETE FROM templates WHERE name = "html-header" AND page = "index" AND section = "default";
ALTER TABLE topics ADD COLUMN series TINYINT DEFAULT 0 NOT NULL;
INSERT INTO vars (name, value, description) VALUES ('bytime_delay','120','days to go back for next/previous links on stories');
INSERT INTO vars (name, value, description) VALUES ('use_prev_next_link_series','0','Boolean where to use next/prev links for articles in a series (topic)');
INSERT INTO vars (name, value, description) VALUES ('use_prev_next_link_section','0','Boolean where to use next/prev links for articles in a section');
INSERT INTO vars (name, value, description) VALUES ('top_sid','','The sid of the most recent story on the homepage');
UPDATE sections SET title='' WHERE title IS NULL;
UPDATE sections SET qid='0' WHERE qid IS NULL;
ALTER TABLE sections CHANGE COLUMN title title VARCHAR(64) DEFAULT '' NOT NULL, CHANGE COLUMN qid qid MEDIUMINT DEFAULT '0' NOT NULL;
# This is a change we're making for Slashdot; it's something to consider
# for your own site, depending on how you have set up your sections.
# The practical change you'll see is that now sectional index.pl Older
# Stuff slashboxes will have a "Yesterday's Edition" link at the bottom.
# UPDATE sections SET issue=3 WHERE issue=1 AND artcount > 0 AND section NOT IN ('polls', 'search');
# End of T_2_3_0_114, Start of T_2_3_0_115 - 2003/08/28
CREATE TABLE badpasswords (
uid mediumint(8) NOT NULL DEFAULT 0,
ip varchar(15) NOT NULL DEFAULT '',
subnet varchar(15) NOT NULL DEFAULT '',
password varchar(20) NOT NULL DEFAULT '',
ts timestamp(14) NOT NULL,
INDEX uid (uid),
INDEX ip (ip),
INDEX subnet (subnet)
) TYPE=InnoDB;
# End of T_2_3_0_115, Start of T_2_3_0_116 - 2003/09/03
# This is probably not necessary for your site, but Slashdot has
# an inconsistency with the CVS schema that this solves, and
# running this should have no effect on a site that's up-to-date.
UPDATE sections SET artcount=0 WHERE artcount IS NULL;
UPDATE sections SET issue=0 WHERE issue IS NULL;
ALTER TABLE sections CHANGE artcount artcount MEDIUMINT NOT NULL DEFAULT 30, CHANGE issue issue TINYINT NOT NULL DEFAULT 0;
# New codes and constants to handle bad login attempts
# For users and admins.
INSERT INTO message_codes (code, type, seclev, modes, send, subscribe) VALUES (13, 'Bad login attempt warnings', 1, 1, 'now', 0);
INSERT INTO vars (name, value, description) VALUES ('bad_password_warn_uid','40','Warn admin if user specifies password incorrectly this many times in one day');
INSERT INTO vars (name, value, description) VALUES ('bad_password_warn_ip','40','Warn admin if an ip specifies password incorrectly this many times in one day');
INSERT INTO vars (name, value, description) VALUES ('bad_password_warn_subnet','60','Warn admin if a subnet specifies password incorrectly this many times in one day');
INSERT INTO vars (name, value, description) VALUES ('bad_password_warn_user_limit','30','Warn a user on the Nth bad password attempt within 24 hours. Set to 0 if you do not want users to be warned');
# if you use the Relocate plugin, add this var and set it appropriately
INSERT INTO vars (name, value, description) VALUES ('relocate_href2slash', 0, 'Automatically convert all A HREF tags to SLASH HREF tags, using relocate.pl.');
# End of T_2_3_0_116, Start of T_2_3_0_117 - 2003/09/12
# End of T_2_3_0_117, Start of T_2_3_0_118 - 2003/09/16
INSERT INTO vars (name, value, description) VALUES ('memcached_exptime_user','1200','Number of seconds a user record lives in memcached before requiring a re-read from the DB (empty string=default, 0=forever)');
INSERT INTO vars (name, value, description) VALUES ('memcached_exptime_comtext','86400','Number of seconds comment text lives in memcached before requiring a re-read from the DB (empty string=default, 0=forever)');
# End of T_2_3_0_118, Start of T_2_3_0_119 - 2003/09/23
INSERT INTO vars (name, value, description) VALUES ('x_forwarded_for_trust_regex','^127\\.0\\.0\\.1$','IP addresses from which we will trust an X-Forwarded-For header');
# if using Slash::Blob
ALTER TABLE blobs ADD COLUMN filename VARCHAR(80) DEFAULT "" NOT NULL AFTER content_type;
# already done on Slashdot, which is probably the only site that will need it :)
ALTER TABLE metamodlog CHANGE id id INT UNSIGNED NOT NULL AUTO_INCREMENT;
# End of T_2_3_0_119, Start of T_2_3_0_120 - 2003/09/28
DELETE FROM vars WHERE name='tailslash_stats';
# Change for plugins/Subscribe (ignore if not using that plugin)
ALTER TABLE subscribe_payments ADD COLUMN payment_type VARCHAR(10) DEFAULT 'user';
ALTER TABLE subscribe_payments ADD COLUMN puid MEDIUMINT UNSIGNED;
UPDATE subscribe_payments SET puid=uid, ts=ts;
ALTER TABLE subscribe_payments ADD INDEX puid (puid);
INSERT INTO vars VALUES ('subscribe_allow_gifts','1','Allow gift subscriptions');
INSERT INTO vars VALUES ('subscribe_gen_transaction_id_length','18','Length of transaction id to generate (up to 32 chars). Best to keep the length of these ids different from outside verifiers to prevent collisions');
INSERT INTO vars VALUES ('subscribe_gift_testing','1','When this is on only admins will be able to see gift subscription form');
# End of T_2_3_0_122, Start of T_2_3_0_123 - 2003/10/28
ALTER TABLE users_acl ADD INDEX acl (acl);
# Set to 1 if you want all future stories displayed in admin stories listing
INSERT INTO vars (name, value, description) VALUES ('show_all_future_stories_admin', 0, 'Turn this on so all future stories are show in the admin stories list');
# End of T_2_3_0_124, Start of T_2_3_0_125 - 2003/11/10
# for messages (adjust to suit your own tastes, but these are new defaults):
REPLACE INTO vars (name, value, description) VALUES ('message_web_expire','14','Number of days to keep message on web site');
REPLACE INTO vars (name, value, description) VALUES ('message_web_maxtotal','25','Number of total messages to keep on web site, per user');
# for relocate plugin if you don't have this installed you don't need this
# this column allows the user to decide what links or groups of links stats are collected for
ALTER TABLE links add stats_type VARCHAR(24);
ALTER TABLE accesslist ADD estimated_users SMALLINT UNSIGNED DEFAULT 1;
UPDATE vars SET description='Seclev for which authors have unlimited comment-moderation and -deletion power (see also the ACLs)' WHERE name='authors_unlimited';
# set to whatever date_format you'd like to use for archived stories, you can set the value to be an empty string if you want it to work as it
# currently does
INSERT INTO vars (name, value, description) VALUES ('archive_dateformat',' %I:%M %p %B %o, %Y','format for dates when stories are archived to shtml');
# currently set to previous defaults -- set as appropriate for your site
# to rewrite archived stories with a new datestamp you will want to set writestatus to dirty for a manageable number of previously archived story
# set your archive_limit var appropriately and probably set your archive_dir to DESC so stories set to be handled newly archived are handled first
# and then older stories are rearchived with the new date format. You only need to do this if you want to change the date_format of archived stories
INSERT INTO vars (name, value, description) VALUES ('archive_dir','ASC','direction we want items to be archived ordered and handled');
INSERT INTO vars (name, value, description) VALUES ('archive_limit','500','maximum number of articles to archive at a time');
# End of T_2_3_0_125, Start of T_2_3_0_126 - 2003/12/02
# Change for plugins/Relocate (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('relocate_keep_count', 1, 'Keep count of click-thrus in the links_for_stories.count column');
# The change below is for plugins/Search (ignore if not using that plugin).
# These control how what method is used for topic search. Using
# topic_search_use_join will return a more complete set of results but
# could result in performance problems for larger sites. The other method
# is a two-select method asking for sids which meet your topic criteria
# first too many sids returned may result in performance problems -- too
# few could result in missing results -- 1000 is a good default but you may
# want to test with different values for these variables to optimize site
# performance and search results.
INSERT INTO vars (name, value, description) VALUES ('topic_search_use_join', 0, 'Controls whether your site uses a join for topic search');
INSERT INTO vars (name, value, description) VALUES ('topic_search_sid_limit', 1000, 'Maximum number of sids to grab on a two-select topic search');
# End of T_2_3_0_126, Start of T_2_3_0_127 - 2003/12/10
# End of T_2_3_0_127, Start of T_2_3_0_128 - 2003/12/11
# End of T_2_3_0_128, Start of T_2_3_0_129 - 2003/12/16
CREATE TABLE users_logtokens (
lid MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
uid MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
locationid CHAR(32) NOT NULL DEFAULT '',
expires DATETIME NOT NULL DEFAULT '2000-01-01 00:00:00',
value CHAR(22) NOT NULL DEFAULT '',
PRIMARY KEY (lid),
UNIQUE uid_locationid (uid, locationid),
KEY (locationid)
) TYPE=InnoDB;
INSERT INTO vars (name, value, description) VALUES ('rss_allow_index', '0', 'Allow RSS feeds to be served from index.pl (1 = admins, 2 = subscribers, 3 = all logged-in users)');
# End of T_2_3_0_129, Start of T_2_3_0_130 - 2003/12/29
INSERT INTO string_param (type, code, name) VALUES ('cookie_location','none','Everywhere');
INSERT INTO string_param (type, code, name) VALUES ('cookie_location','classbid','My Subnet');
INSERT INTO string_param (type, code, name) VALUES ('cookie_location','ipid','My IP Address');
REPLACE INTO code_param (type, code, name) VALUES ('session_login',0,'In one year');
REPLACE INTO code_param (type, code, name) VALUES ('session_login',1,'When I close my browser');
ALTER TABLE users_info ADD COLUMN cookie_location enum("classbid","subnetid","ipid","none") DEFAULT "classbid" NOT NULL AFTER session_login;
ALTER TABLE users_logtokens ADD COLUMN temp ENUM("yes","no") NOT NULL DEFAULT "no" AFTER locationid;
ALTER TABLE users_logtokens DROP INDEX uid_locationid;
ALTER TABLE users_logtokens ADD UNIQUE uid_locationid_temp (uid, locationid, temp);
ALTER TABLE users_logtokens ADD KEY (temp);
INSERT INTO vars (name, value, description) VALUES ('login_temp_minutes', '10', 'Minutes before a temporary login expires');
# End of T_2_3_0_130, Start of T_2_3_0_131 - 2003/12/31
INSERT INTO vars (name, value, description) VALUES ('cookie_location','none','Default for user\'s cookie_location value (also see users_info schema!)');
UPDATE vars SET value=CONCAT(value,'|DL|DT|DD') WHERE name='approvedtags';
UPDATE vars SET value=CONCAT(value,'|DL|DT|DD') WHERE name='approvedtags_break';
# Change for plugins/Stats (ignore if not using that plugin)
ALTER TABLE stats_daily ADD UNIQUE section_day_name (section, day, name);
UPDATE vars set description='Ops to omit from daily counts in adminmail (delimiter of |)' where name = "op_exclude_from_countdaily";
INSERT INTO vars (name, value, description) VALUES ('op_extras_countdaily', '', 'Extra site-specific pagetypes/ops you would like listed (delimiter of |)');
# Change for plugins/PollBooth -- set according to your preferences (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('allow_anon_poll_voting', '1', 'Set this to decide whether anonymous users can vote in polls)');
ALTER TABLE moderatorlog ADD COLUMN points_orig tinyint DEFAULT NULL;
### do these ONLY IF you want cookies to work everywhere by default ...
### it may invalidate existing user cookies if you've previously
### been using logtokens, so beware -- pudge
# If your MySQL is a version prior to 4.0.1, the next command will
# fail; the fix is simple, just eliminate the "AFTER session_login".
ALTER TABLE users_info MODIFY COLUMN cookie_location enum("classbid","subnetid","ipid","none") DEFAULT "none" NOT NULL AFTER session_login;
REPLACE INTO vars (name, value, description) VALUES ('cookie_location','none','Default for user\'s cookie_location value (also see users_info schema!)');
REPLACE INTO string_param (type, code, name) VALUES ('cookie_location','none','follows me everywhere');
REPLACE INTO string_param (type, code, name) VALUES ('cookie_location','classbid','moves within a subnet');
REPLACE INTO string_param (type, code, name) VALUES ('cookie_location','ipid','never moves');
REPLACE INTO code_param (type, code, name) VALUES ('session_login',0,'lasts forever');
REPLACE INTO code_param (type, code, name) VALUES ('session_login',1,'closes with browser');
# End of T_2_3_0_131, Start of T_2_3_0_132 - 2004/01/27
INSERT INTO vars (name, value, description) VALUES ('common_story_words', 'about above across after again against almost along already also although always among another anyone arise around aside asked available away became because become becomes been before began behind being better between both brought called came can\'t cannot certain certainly come could days didn\'t different does done down during each either else enough especially even ever every fact find following form found from further gave gets give given gives giving going gone hardly have having here himself however http important into it\'s itself just keep kept knew know known largely later least like look made mainly make many maybe might more most mostly much must nearly neither never next none noted nothing obtain obtained often once only other others ought over overall owing particularly past people perhaps please possible present probably quite rather read ready really right said same saying says seem seems seen several shall should show showed shown shows similar similarly since some something sometime sometimes somewhat soon such sure take taken tell than that that\'s their theirs them themselves then there therefore these they thing things think this those though through throughout thus time together told took toward turn under unless until upon used using usually various very want well were what what when where whether which while whole whom whose wide widely will will with within without would year years your', 'Words which are considered too common to be used in detecting "similar" stories');
# End of T_2_3_0_132, Start of T_2_3_0_133 - 2004/01/30
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_minfairfrac', '0.8', 'Fraction of Fair metamods a mod has to get for its user to be eligible for the m2 csq bonuses');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_earlymod_secs', '1800', 'Fairly moderate a comment within this many seconds of its being posted and gain a token bonus');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_earlymod_tokenmult', '1.1', 'Fairly moderate a comment early, and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_quintile_1', '0.9', 'Fairly moderate a comment in the first 20% of a discussion and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_quintile_2', '1.0', 'Fairly moderate a comment in the second 20% of a discussion and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_quintile_3', '1.1', 'Fairly moderate a comment in the third 20% of a discussion and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_quintile_4', '1.1', 'Fairly moderate a comment in the fourth 20% of a discussion and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_quintile_5', '1.1', 'Fairly moderate a comment in the last 20% of a discussion and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_replypost_tokenmult', '1.2', 'Fairly moderate a reply, instead of a top-level comment, and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_pointsorig_-1', '1.1', 'Fairly moderate a comment from this score, and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_pointsorig_0', '1.2', 'Fairly moderate a comment from this score, and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_pointsorig_1', '1.1', 'Fairly moderate a comment from this score, and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_pointsorig_2', '1.0', 'Fairly moderate a comment from this score, and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_pointsorig_3', '0.8', 'Fairly moderate a comment from this score, and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_pointsorig_4', '0.5', 'Fairly moderate a comment from this score, and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_bonus_pointsorig_5', '0.8', 'Fairly moderate a comment from this score, and gain this bonus multiplier');
INSERT INTO vars (name, value, description) VALUES ('mod_down_karmacoststyle', '0', '0=old (downmod costs 1 karma), 1=new (downmod costs pointsmax-new_points karma)');
ALTER TABLE comments ADD COLUMN pointsmax TINYINT NOT NULL DEFAULT 0 AFTER pointsorig, ADD COLUMN karma SMALLINT NOT NULL DEFAULT 0, ADD COLUMN karma_abs SMALLINT UNSIGNED NOT NULL DEFAULT 0;
UPDATE comments SET pointsmax=points;
ALTER TABLE users_info ADD COLUMN initdomain VARCHAR(30) DEFAULT '' NOT NULL AFTER user_expiry_comm, ADD COLUMN created_ipid VARCHAR(32) DEFAULT '' NOT NULL AFTER initdomain;
ALTER TABLE users_info ADD INDEX initdomain (initdomain), ADD INDEX created_ipid (created_ipid);
# If you want correct values for your existing users' column
# users_info.initdomain, try running this quick script
# (replace virtusername with your DBIx::Password user):
# perl -MSlash::Test=virtusername -e 'my $arr = $reader_db->sqlSelectAll("uid, realemail", "users"); for my $ar (@$arr) { next unless $ar->[1]; $d=fullhost_to_domain($ar->[1]); push @{$du{$d}}, $ar->[0] } undef $arr; while (($k, $v) = each %du) { $in = join(",", @$v); $slashdb->sqlUpdate("users_info", { initdomain => $k }, "uid IN ($in)"); sleep(0.1) if scalar(@$v) > 100 }'
INSERT INTO vars (name, value, description) VALUES ('istroll_max_halflives', '3', 'Max number of times to cut the TrollModval impact of a downmod in half');
# End of T_2_3_0_133, Start of T_2_3_0_134 - 2004/02/03
DROP TABLE IF EXISTS accesslog_artcom;
CREATE TABLE accesslog_artcom (
uid MEDIUMINT UNSIGNED NOT NULL,
ts DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
c SMALLINT UNSIGNED NOT NULL DEFAULT '0',
INDEX uid (uid),
INDEX ts (ts)
) TYPE=InnoDB;
INSERT INTO vars (name, value, description) VALUES ('moderatord_lastmaxid', '0', 'Last accesslog.id seen by run_moderatord');
INSERT INTO vars (name, value, description) VALUES ('moderatord_maxrows', '50000', 'Max number of accesslog rows to process at once in run_moderatord');
INSERT INTO vars (name, value, description) VALUES ('accesslog_hoursback', '60', 'Number of hours before accesslog rows are purged');
# End of T_2_3_0_134, Start of T_2_3_0_135 - 2004/02/04
DROP TABLE IF EXISTS slashd_errnotes;
CREATE TABLE slashd_errnotes (
ts DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
taskname VARCHAR(50) NOT NULL DEFAULT 'SLASHD',
line MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
errnote VARCHAR(255) NOT NULL DEFAULT '',
moreinfo TEXT DEFAULT NULL,
INDEX (ts),
INDEX taskname_ts (taskname, ts)
) TYPE=InnoDB;
# Change for plugins/HumanConf (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('hc_possible_fonts', '', 'Possible fonts to use (space-separated, empty for the default)');
INSERT IGNORE INTO vars (name, value, description) VALUES ('hc_pool_secs_before_del', '21600', 'Number of seconds after a pool entry last used before it will be deleted');
INSERT IGNORE INTO vars (name, value, description) VALUES ('hc_pool_secs_before_use', '3600', 'Number of seconds after a pool entry created before it will be used');
INSERT INTO vars (name, value, description) VALUES ('hc_q1_margin', '6', 'For question 1 (images), margin around the image in pixels');
INSERT INTO vars (name, value, description) VALUES ('hc_q1_maxrad', '0.2', 'For question 1 (images), maximum number of radians to rotate (positive or negative, so the range is twice this)');
# End of T_2_3_0_136, Start of T_2_3_0_137 - 2004/02/12
# Changes for plugins/Messages (ignore if not using that plugin)
ALTER TABLE message_codes ADD COLUMN acl VARCHAR(32) DEFAULT '' NOT NULL;
UPDATE message_codes SET acl = 'stats' WHERE code = 10;
INSERT INTO message_codes (code, type, seclev, modes, acl) VALUES (14, 'Daily Moderation Stats', 100, 0, 'stats');
INSERT INTO vars (name, value, description) VALUES ('tids_in_urls', '0', 'Want tid=1&tid=2 in story and discussion-related URLs?');
# End of T_2_3_0_137, Start of T_2_3_0_138 - 2004/02/17
INSERT INTO vars (name, value, description) VALUES ('admin_comment_display_days', '30', 'Number of days back worth of comments to show admin on a user page');
INSERT INTO vars (name, value, description) VALUES ('admin_daysback_commentlimit', '100', 'Limit on number of comments to show on initial page for X days back of comments (Empty string for no limit)');
INSERT INTO vars (name, value, description) VALUES ('admin_comment_subsequent_pagesize', '50', 'Number of comments to show per page for admins on pages past the intial one');
INSERT INTO vars (name, value, description) VALUES ('show_mods_with_comments', '1', 'Show moderations intertwined with comments on user pages?');
INSERT INTO vars (name, value, description) VALUES ('mod_limit_with_comments', '', 'Maximum number of moderations to show intertwined with a group of comments (Empty string for no limit)');
INSERT INTO vars (name, value, description) VALUES ('show_m2s_with_mods', '1', 'Show metamods intertwined with mods?');
INSERT INTO vars (name, value, description) VALUES ('m2_limit_with_mods', '', 'Maximum number of metamods to show intertwined with a group of mods (Empty string for no limit)');
# End of T_2_3_0_138, Start of T_2_3_0_139 - 2004/02/25
INSERT INTO vars (name, value, description) VALUES ('anchortags_bridge_breaks', '0', 'Are <A> tags allowed to stretch across breaking tags (defined in approvedtags_break)?');
# End of T_2_3_0_139, Start of T_2_3_0_140 - 2004/02/26
ALTER TABLE message_drop CHANGE COLUMN message message MEDIUMBLOB DEFAULT '' NOT NULL;
INSERT INTO vars (name, value, description) VALUES ('approvedtags_attr', 'a:href_RU img:src_RU,alt,width,height,longdesc_U', 'definition of approvedtags attributes in the following format a:href_RU img:src_RU,alt,width,height,longdesc_U see Slash::Utility::Data.pm for more details');
# End of T_2_3_0_140, Start of T_2_3_0_141 - 2004/03/03
UPDATE vars SET description='Show HTML comments before and after template? (see Slash::Display) 0=no 1=yes unless Nocomm 2=ALWAYS (debugging only!)' WHERE name='template_show_comments';
INSERT INTO vars (name, value, description) VALUES ('store_com_page1_min_cid_for_user_com_cnt',1000,"Caches the minimum cid shown on a user's first page of comments shown if their commentcount is >= this val. This can speed up future queries. Set to 0 to disable this.");
INSERT INTO vars (name, value, description) VALUES ('submissions_listing_page_size', 24, "Number of submissions shown per page on a user page. Set to 0 to show all");
# End of T_2_3_0_141, Start of T_2_3_0_142 - 2004/03/09
# Changes for plugins/Hof (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('hof_do_not_count', '', 'Do not list stories with these (space-separated) sids in hof.pl');
# End of T_2_3_0_142, Start of T_2_3_0_143 - 2004/03/10
INSERT INTO vars (name, value, description) VALUES ('accesslog_imageregex', '^/images/hc/', 'Image hits will only be written into accesslog if their URL path matches this regex, empty string for all, NONE for none');
INSERT INTO vars (name, value, description) VALUES ('m2_consequences_repeats','3=-4|5=-12|10=-100','Token penalties for modding same user multiple times, applied at M2 reconcile time');
INSERT INTO vars (name, value, description) VALUES ('comment_karma_limit','','Max karma that a single comment can cost a user, normally negative values or 0 to never take karma with downmods, empty string for unlimited');
# End of T_2_3_0_143, Start of T_2_3_0_144 - 2004/03/16
DELETE from vars where name = "submissions_listing_page_size";
INSERT INTO vars (name, value, description) VALUES ('submissions_accepted_only_page_size', 20, "Number of submissions shown per page when only accepted submissions are shown. Set to 0 to show all");
INSERT INTO vars (name, value, description) VALUES ('submissions_all_page_size', 40, "Number of submissions shown per page on a user page when all submission statuses are shown. Set to 0 to show all");
INSERT INTO menus(id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL,'security','Stories','stories','[% gSkin.rootdir %]/admin.pl',100,0,1);
INSERT INTO menus(id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL,'security','Mods','recent_mods','[% gSkin.rootdir %]/admin.pl?op=recent_mods',500,0,2);
INSERT INTO menus(id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL,'security','Reqs','requests','[% gSkin.rootdir %]/admin.pl?op=recent_requests',500,0,3);
INSERT INTO menus(id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL,'security','Posting','recent','[% gSkin.rootdir %]/admin.pl?op=recent',500,0,4);
INSERT INTO menus(id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL,'security','Abusers','abusers','[% gSkin.rootdir %]/users.pl?op=topabusers',100,0,5);
INSERT INTO menus(id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL,'security','Read&nbsp;Only','readonly','[% gSkin.rootdir %]/users.pl?op=listreadonly',100,0,6);
INSERT INTO menus(id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL,'security','Banned','banned','[% gSkin.rootdir %]/users.pl?op=listbanned',100,0,7);
INSERT INTO menus(id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL,'security','Info','stats','[% gSkin.rootdir %]/stats.pl',100,0,8);
INSERT INTO menus(id, menu, label, sel_label, value, seclev, showanon, menuorder) VALUES (NULL,'security','Config','config','[% gSkin.rootdir %]/admin.pl?op=topics',10000,0,9);
# End of T_2_3_0_144, Start of T_2_3_0_145 - 2004/03/23
ALTER TABLE users_info ADD COLUMN csq_bonuses FLOAT NOT NULL DEFAULT '0';
ALTER TABLE moderatorlog ADD COLUMN m2needed MEDIUMINT UNSIGNED DEFAULT '0' AFTER m2count;
# If your MySQL is a version prior to 4.0.2, the next command
# will fail; just do it by hand:
# SELECT value FROM vars WHERE name='m2_consensus';
# UPDATE moderatorlog SET m2needed=(that value) WHERE m2needed=0;
UPDATE moderatorlog, vars SET moderatorlog.m2needed = vars.value WHERE vars.name='m2_consensus' AND m2needed=0;
INSERT INTO vars (name, value, description) VALUES ('comments_portscan_anon_for_proxy', '0', 'If true, when anonymous posting is attempted, try to access our own site ok.txt using incoming IP as a proxy, and forbid posting if successful');
INSERT INTO vars (name, value, description) VALUES ('comments_portscan_cachehours', '48', 'If comments_portscan_anon_for_proxy is true, hours to cache a result of a portscan for open proxies on a particular IP');
INSERT INTO vars (name, value, description) VALUES ('comments_portscan_ports', '80 8080 8000 3128', 'If comments_portscan_anon_for_proxy is true, scan these space-separated ports');
INSERT INTO vars (name, value, description) VALUES ('comments_portscan_timeout', '5', 'If comments_portscan_anon_for_proxy is true, use this as timeout');
CREATE TABLE open_proxies (
ip VARCHAR(15) NOT NULL,
port SMALLINT UNSIGNED NOT NULL DEFAULT '0',
ts DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (ip),
KEY ts (ts)
) TYPE=InnoDB;
# End of T_2_3_0_145, Start of T_2_3_0_146 - 2004/03/24
# End of T_2_3_0_146, Start of T_2_3_0_147 - 2004/03/25
UPDATE vars SET name='comments_portscan', description='Scan incoming IPs for open proxy ports? 0=never, 1=anon posting only, 2=all posting' WHERE name='comments_portscan_anon_for_proxy';
ALTER TABLE code_param CHANGE COLUMN type type VARCHAR(24) NOT NULL DEFAULT '';
UPDATE code_param SET type='section_topic_types' WHERE type='section_topic_ty';
UPDATE code_param SET type='displaycodes_sectional' WHERE type='displaycodes_sec';
ALTER TABLE badpasswords ADD COLUMN realemail VARCHAR(50) NOT NULL DEFAULT '';
DROP TABLE topic_image_sections;
# this determine how metamoderation consensus is calculated. If you choose sliding consensus you can set the number required for consensus based on the count
# of moderations performed against a cid-reason pair
INSERT INTO vars (name, value, description) VALUES ('m2_sliding_consensus', "5|7|9", "Array of consensus values chosen by count of mods for a particular cid-reason pair 5|7|9 means count 1 consensus 5, count 2 consensus 7, count >=3 consensus of 9");
INSERT INTO vars (name, value, description) VALUES ('m2_use_sliding_consensus', 0, "Use sliding value for number of metamods needed for consensus -- consensus number is based on count of moderations for a cid-reason pair");
INSERT INTO vars (name, value, description) VALUES ('mailpasswd_portscan', '0', 'If true, when sending a password is attempted, try to access our own site ok.txt using incoming IP as a proxy, and forbid mailing if successful');
INSERT INTO vars (name, value, description) VALUES ('newuser_portscan', '0', 'If true, when creating a new user account is attempted, try to access our own site ok.txt using incoming IP as a proxy, and forbid account creation if successful');
ALTER TABLE open_proxies ADD COLUMN xff VARCHAR(15) DEFAULT NULL;
INSERT INTO vars (name, value, description) VALUES ('adjust_m2_freq', '0', 'If true, m2_freq will be automatically adjusted to match rates of m1s and m2s');
#Set these to suitable mins and maxes for your site. These are only applied if adjust_m2_freq is true
INSERT INTO vars (name, value, description) VALUES ('m2_freq_min', '42300', 'Min value m2_freq will be automatically adjusted to');
INSERT INTO vars (name, value, description) VALUES ('m2_freq_max', '172800', 'Max value m2_freq will be automatically adjusted to');
ALTER TABLE comments ADD COLUMN tweak_orig TINYINT NOT NULL DEFAULT 0 AFTER karma_abs, ADD COLUMN tweak TINYINT NOT NULL DEFAULT 0;
INSERT INTO vars (name, value, description) VALUES ('m2_inherit', '0', 'Set to true if you would like to inherit m2s from previous mods with the same cid-reason');
ALTER TABLE users_info ADD COLUMN up_fair MEDIUMINT UNSIGNED DEFAULT '0' NOT NULL AFTER m2fair, ADD COLUMN down_fair MEDIUMINT UNSIGNED DEFAULT '0' NOT NULL AFTER up_fair, ADD COLUMN up_unfair MEDIUMINT UNSIGNED DEFAULT '0' NOT NULL AFTER m2unfair, ADD COLUMN down_unfair MEDIUMINT UNSIGNED DEFAULT '0' NOT NULL AFTER up_unfair, ADD COLUMN m2voted_up_fair MEDIUMINT UNSIGNED DEFAULT '0' NOT NULL AFTER m2fairvotes, ADD COLUMN m2voted_down_fair MEDIUMINT UNSIGNED DEFAULT '0' NOT NULL AFTER m2voted_up_fair, ADD COLUMN m2voted_up_unfair MEDIUMINT UNSIGNED DEFAULT '0' NOT NULL AFTER m2unfairvotes, ADD COLUMN m2voted_down_unfair MEDIUMINT UNSIGNED DEFAULT '0' NOT NULL AFTER m2voted_up_unfair, ADD COLUMN m2voted_lonedissent mediumint UNSIGNED DEFAULT '0' NOT NULL AFTER m2voted_down_unfair, ADD COLUMN m2voted_majority mediumint UNSIGNED DEFAULT '0' NOT NULL AFTER m2voted_lonedissent;
INSERT INTO vars (name, value, description) VALUES ('karma_posting_penalty_style', '0', '0=old (starting score decremented), 1=new (display score shown lower, comment can suffer results of additional downvotes)');
# End of T_2_3_0_149, Start of T_2_3_0_150 - 2004/04/13
# End of T_2_3_0_150, Start of T_2_3_0_151 - 2004/04/20
INSERT INTO vars (name, value, description) VALUES ('m2_if_smoother',5,'Number that acts as multiplier for the if_expr, should probably be around your average m2needed/consensus value');
INSERT INTO vars (name, value, description) VALUES ('subnet_karma_post_limit_range','-5|-9|-10|-999999','range of subnet karma to block posting at -5|-9|-10|-999999 blocks anonymous posting at -5 to -9 subnet karma, and all posting from -10 to -999999 subnet karma');
INSERT INTO vars (name, value, description) VALUES ('subnet_karma_comments_needed','5','Number of comments needed before subnet karma is used for disallowing posting');
INSERT INTO vars (name, value, description) VALUES ('maxtokens_add','3','Max tokens to give any one user per pass');
# End of T_2_3_0_151, Start of T_2_3_0_152 - 2004/04/27
# only if using HumanConf, and you want to have a better value ...
UPDATE vars SET value = 10 WHERE name = "hc_pool_secs_before_use";
INSERT INTO vars (name, value, description) VALUES ('hc_image_format','jpeg','Format for HC images (png, jpeg)');
INSERT INTO vars (name, value, description) VALUES ('m2_wait_hours','12','Number of hours to wait before a mod is available for m2');
UPDATE menus SET value='[% gSkin.rootdir %]/my/password' WHERE menu='users' AND label='Password';
### everyone should run install-plugin to install the Login theme
ALTER TABLE open_proxies ADD COLUMN ipid char(32) DEFAULT '' NOT NULL;
ALTER TABLE open_proxies ADD INDEX ipid (ipid);
UPDATE open_proxies SET ipid=md5(ip);
INSERT INTO vars (name, value, description) VALUES ('login_speed_limit', '20', 'How fast a user can create users, etc.');
INSERT INTO vars (name, value, description) VALUES ('max_login_allowed', '10', 'How many forms a user can submit');
# be wary of this, make sure you've not modified it on your own; if so, add 'login' yourself
UPDATE vars SET value = '^(?:comments|(?:login|users)/(?:nu|mp))$' WHERE name = 'hc_formname_regex';
INSERT INTO vars (name, value, description) VALUES ('email_domains_invalid', 'example.com mailinator.com', 'space separated list of domains that are not valid for email addresses');
# Apparently on some installations jpg() works, but the name of the
# method is GD::Image::jpeg() and that's more compatible.
UPDATE vars SET description='Format for HC images (png, jpeg)' WHERE name='hc_image_format';
UPDATE vars SET value='jpeg' WHERE name='hc_image_format' AND value='jpg';
# End of T_2_3_0_153, Start of T_2_3_0_154 - 2004/05/11
INSERT INTO vars (name, value, description) VALUES ('submit_domains_invalid', 'example.com peoplesprimary.com', 'space separated list of domains that are not valid for submitting stories');
# Install Lingua::Stem
INSERT INTO vars (name, value, description) VALUES ('stem_uncommon_words', '1', 'Use stems of words for detecting similar stories instead of whole words?');
INSERT INTO vars (name, value, description) VALUES ('m2_oldest_wanted', '10', 'How old can un-M2d mods get before they are considered important to get fully reconciled?');
INSERT INTO vars (name, value, description) VALUES ('m2_oldest_zone_percentile', '2', 'What percentile of the oldest un-M2d mods are to be considered highest priority?');
INSERT INTO vars (name, value, description) VALUES ('m2_oldest_zone_mult', '2', 'How many times the normal amount of M2s are applied to the oldest un-M2d mods?');
INSERT INTO vars (name, value, description) VALUES ('m2_oldzone', '0', 'Starting id (youngest) of the old-zone of moderations that still require M2 (the oldest certain percentile)');
# End of T_2_3_0_154, Start of T_2_3_0_155 - 2004/05/18
INSERT INTO vars (name, value, description) VALUES ('cur_performance_stats', '', 'Stores current performance stats in a var for display to admins');
INSERT INTO vars (name, value, description) VALUES ('cur_performance_stats_disp', '1', 'Show current performance stats?');
INSERT INTO vars (name, value, description) VALUES ('cur_performance_stat_ops', 'article|comments|index', 'ops to show current performance stats for');
INSERT INTO vars (name, value, description) VALUES ('cur_performance_stats_lastid', '0', 'accesslogid to start searching at');
INSERT INTO vars (name, value, description) VALUES ('cur_performance_stats_weeks', '8', 'number of weeks back to compare current stats to');
ALTER TABLE comments ADD INDEX uid_date (uid,date);
# Switching this on may help performance on large sites. Don't turn on until you've created the uid_date index
INSERT INTO vars (name, value, description) VALUES ('user_comments_force_index', '0', 'Give user comments query hint to use specific index?');
# End of T_2_3_0_155, Start of T_2_3_0_156 - 2004/05/25
INSERT INTO vars (name, value, description) VALUES ('ignore_uid_date_index', '1', 'Ignore uid_date index on comments where it may slow performance');
######################################################################
######################################################################
# End of T_2_3_0_156, Start of T_2_5_0_1 - 2004/07/01
# End of T_2_5_0_1, Start of T_2_5_0_2 - 2004/07/02
# End of T_2_5_0_2, Start of T_2_5_0_3 - 2004/07/02
# End of T_2_5_0_3, Start of T_2_5_0_4 - 2004/07/02
######################################################################
# See the comments at the top of utils/convertDBto200406 (v 1.28 or
# later) for instructions on upgrading a Slash site from a T_2_3_* tag
# to a T_2_5_* tag!
######################################################################
# You probably want to install the CPAN module GraphViz here, along
# with whatever it needs; see plugins/Admin/README for details.
# If you don't, set topic_tree_draw to 0 instead of 1.
# Changes for plugins/Admin (which you are almost certainly using)
INSERT INTO vars (name, value, description) VALUES ('topic_tree_draw', '1', 'Draw the images/topic_tree.png?');
INSERT INTO vars (name, value, description) VALUES ('topic_tree_draw_fontname', 'freefont/FreeMono', 'Name of font used for labels in the topic tree');
INSERT INTO vars (name, value, description) VALUES ('topic_tree_draw_fontsize', '10', 'Size of font used for labels in the topic tree');
INSERT INTO vars (name, value, description) VALUES ('topic_tree_lastchange', '1', 'Unix timestamp of last change to the topic tree');
INSERT INTO vars (name, value, description) VALUES ('topic_tree_lastdraw', '1', 'Unix timestamp of last time topic_tree_draw.pl redrew images/topic_tree.png');
INSERT INTO menus (menu, label, sel_label, value, seclev, menuorder) VALUES ('info','Tree','Tree','[% gSkin.rootdir %]/admin.pl?op=topictree',100,9);
UPDATE menus SET label = '[% user.nickname | strip_literal %]\'s Journal' WHERE label = '[% user.nickname %]\'s Journal' AND menu = 'journal';
# End of T_2_5_0_4, Start of T_2_5_0_5 - 2004/07/06
INSERT INTO vars (name, value, description) VALUES ('admin_story_lookahead_mainpage', 72*3600, 'In the admin.pl storylist, how many seconds to look into the future for stories on the mainpage');
INSERT INTO vars (name, value, description) VALUES ('admin_story_lookahead_default', 365*86400, 'In the admin.pl storylist, how many seconds to look into the future for all stories by default (but see skins_admin_story_lookahead_mainpage)');
UPDATE vars SET name='admin_story_lookahead_infinite', description='In the admin.pl storylist, always show all future stories no matter how far in the future?' WHERE name='show_all_future_stories_admin';
INSERT IGNORE INTO vars (name, value, description) VALUES ('admin_story_lookahead_infinite', '0', 'In the admin.pl storylist, always show all future stories no matter how far in the future?');
# End of T_2_5_0_5, Start of T_2_5_0_6 - 2004/07/08
UPDATE IGNORE blocks SET bid='mainpage_more' WHERE bid LIKE '%more' AND skin='mainpage' AND ordernum > -1;
DELETE FROM blocks WHERE bid LIKE '%more' AND skin='mainpage' AND bid != 'mainpage_more';
# End of T_2_5_0_6, Start of T_2_5_0_7 - 2004/07/08
UPDATE vars SET description = 'default code for article comments- normally "enabled"' WHERE name = 'defaultcommentstatus';
UPDATE vars SET value = 'enabled' WHERE name = 'defaultcommentstatus' AND value = '0';
# End of T_2_5_0_7, Start of T_2_5_0_8 - 2004/07/12
# This next line may throw an error if the spurious column has
# already been removed. That's OK.
ALTER TABLE skins DROP COLUMN min_weight;
ALTER TABLE topic_parents ALTER COLUMN min_weight SET DEFAULT 10;
UPDATE topic_parents SET min_weight = min_weight * 10 WHERE min_weight < 10;
UPDATE story_topics_chosen SET weight = weight * 10 WHERE weight < 10;
# If this next line throws an error saying there is no 'weight' column,
# that's OK, ignore it.
UPDATE story_topics_rendered SET weight = weight * 10 WHERE weight < 10;
# Changes for plugins/Admin (which you are almost certainly using)
INSERT INTO vars (name, value, description) VALUES ('topic_popup_defaultweight', '10', 'Default weight for new topics in the popup menu (should probably match default for topic_parents.min_weight)');
# End of T_2_5_0_8, Start of T_2_5_0_9 - 2004/07/13
ALTER TABLE stories_old ADD COLUMN stoid MEDIUMINT UNSIGNED DEFAULT '0';
UPDATE stories_old, stories SET stories_old.stoid=stories.stoid WHERE stories_old.sid=stories.sid;
INSERT IGNORE INTO story_param (stoid, name, value) SELECT stoid, 'neverdisplay', 1 FROM stories_old WHERE displaystatus=-1;
# Run this perl script to make sure stories set to Never Display have the
# appropriate value in story_param.
# perl -MSlash::Test=YOURVIRTUALUSER -le '$nd_hr = $slashdb->displaystatusForStories($slashdb->sqlSelectColArrayref("stoid", "stories")); @nd = grep { $nd_hr->{$_} == -1 } keys %$nd_hr; for my $stoid (@nd) { $slashdb->sqlInsert("story_param", { stoid => $stoid, name => "neverdisplay", value => "1" }, { ignore => 1 }); }'
DELETE FROM templates WHERE name = 'skinindexd' AND skin != 'default';
ALTER TABLE skins ADD COLUMN submittable ENUM('no', 'yes') DEFAULT 'yes' NOT NULL AFTER issue;
UPDATE skins SET submittable='no' WHERE name='search';
# Changes for plugins/Admin (which you are almost certainly using)
INSERT INTO vars (name, value, description) VALUES ('admin_maxdays_divider', '14', 'Max number of days on the admin.pl story list to bother showing the day-dividers');
# End of T_2_5_0_9, Start of T_2_5_0_10 - 2004/07/16
INSERT INTO vars (name, value, description) VALUES ('gse_min_stoid', '0', 'Minimum stoid that getStoriesEssentials - important index.pl optimization - this value set automatically');
# End of T_2_5_0_10, Start of T_2_5_0_11 - 2004/07/17
# End of T_2_5_0_11, Start of T_2_5_0_12 - 2004/07/19
# End of T_2_5_0_12, Start of T_2_5_0_13 - 2004/07/19
INSERT INTO vars (name, value, description) VALUES ('freshenup_small_cc','30','How many comments is considered a small commentcount, indicating a story needs its commentcount updated frequently?');
# End of T_2_5_0_13, Start of T_2_5_0_14 - 2004/07/19
INSERT INTO vars (name, value, description) VALUES ('cur_performance_pps', '', 'Pages per second the site is running at');
# End of T_2_5_0_14, Start of T_2_5_0_15 - 2004/07/20
# End of T_2_5_0_15, Start of T_2_5_0_16 - 2004/07/22
# End of T_2_5_0_16, Start of T_2_5_0_17 - 2004/07/26
INSERT INTO vars (name, value, description) VALUES ('submission_default_skid', '0', 'Skid you would like selected by default for submissions, 0 or empty string for none');
INSERT INTO vars (name, value, description) VALUES ('submission_force_default', '0', 'Force selection of default skid for all submissions, takes away menu of options');
# End of T_2_5_0_17, Start of T_2_5_0_18 - 2004/08/01
ALTER TABLE dbs ADD COLUMN weight tinyint UNSIGNED NOT NULL DEFAULT 1;
INSERT INTO vars (name, value, description) VALUES ('debughash_getSkins','','false = no debugging; default regex = ^\d+$');
INSERT INTO vars (name, value, description) VALUES ('debughash_getTopicTree','','false = no debugging; default regex = ^\d+$');
# End of T_2_5_0_18, Start of T_2_5_0_19 - 2004/08/03
ALTER TABLE story_topics_chosen ADD INDEX tid_stoid (tid, stoid), DROP INDEX tid;
# If this next line throws an error saying the indexes already
# exist and don't, respectively, that's OK, ignore it.
ALTER TABLE story_topics_rendered ADD INDEX tid_stoid (tid, stoid), DROP INDEX tid;
# End of T_2_5_0_19, Start of T_2_5_0_20 - 2004/08/05
INSERT INTO vars (name, value, description) VALUES ('gse_precache_mins_ahead','2','How many minutes ahead to precache getStoriesEssentials data in the query cache and memcached?');
# End of T_2_5_0_20, Start of T_2_5_0_21 - 2004/08/05
ALTER TABLE comments ADD INDEX date_sid (date, sid);
ALTER TABLE stories ADD INDEX discussion_stoid (discussion, stoid);
ALTER TABLE moderatorlog ADD INDEX ts_uid_sid (ts, uid, sid);
DROP TABLE IF EXISTS topic_param;
CREATE TABLE topic_param (
param_id mediumint UNSIGNED NOT NULL auto_increment,
tid SMALLINT UNSIGNED NOT NULL,
name varchar(32) DEFAULT '' NOT NULL,
value text NOT NULL,
UNIQUE topic_key (tid,name),
PRIMARY KEY (param_id)
) TYPE=InnoDB;
# It's suggested you don't log image requests to accesslog for performance reasons with the new
# log_db_qps task. If your site isn't very busy it may not matter
# To turn off image logging:
# UPDATE vars set value = 'NONE' where name='accesslog_imageregex';
UPDATE vars SET name='m1_pointgrant_factor_upfairratio', description='Factor of upmods fairness ratio in deciding who is eligible for moderation (1=irrelevant, 2=top user twice as likely)' WHERE name='m1_pointgrant_factor_fairratio';
INSERT INTO vars (name,value,description) SELECT 'm1_pointgrant_factor_downfairratio', value, 'Factor of downmods fairness ratio in deciding who is eligible for moderation (1=irrelevant, 2=top user twice as likely)' FROM vars WHERE name='m1_pointgrant_factor_upfairratio';
INSERT INTO vars (name, value, description) VALUES ('topcomm_days','1','Look back (n) days to display the Hot Comments slashbox');
INSERT INTO vars (name, value, description) VALUES ('dbs_revive_seconds','30','After a DB goes from isalive=no to yes, ramp up accesses to it over how many seconds?');
# Only run these on your search db. If the latter throws a
# "Duplicate key" error, that's fine.
ALTER TABLE submissions TYPE=MyISAM;
ALTER TABLE submissions ADD FULLTEXT subj (subj,story);
# Depending on when you converted your site to section/topics
# you may or may not need to run these. If your stats_daily
# table has a section column you need to run these
UPDATE stats_daily set skid=0 where section='all';
ALTER TABLE stats_daily DROP COLUMN section;
ALTER TABLE topic_nexus_extras MODIFY COLUMN extras_id MEDIUMINT UNSIGNED NOT NULL auto_increment;
INSERT INTO vars (name, value, description) VALUES ('topic_popup_open', '1', 'Expand all topics by default, or not');
# End of T_2_5_0_22, Start of T_2_5_0_23 - 2004/08/31
INSERT INTO vars (name, value, description) VALUES ('gse_table_join_row_cutoff', '1000', 'Number of stoids below which getStoriesEssentials performs 2 separate selects and above which it performs a JOIN');
# End of T_2_5_0_23, Start of T_2_5_0_24 - 2004/09/01
ALTER TABLE topic_nexus_extras ADD COLUMN content_type ENUM("story","comment") NOT NULL DEFAULT 'story';
# End of T_2_5_0_24, Start of T_2_5_0_25 - 2004/09/03
INSERT INTO vars (name, value, description) VALUES ('gse_skip_count_if_no_min_stoid', '0', 'If no min_stoid is available, skip counting the s_t_r rows and go straight to the one-table select? Rule of thumb, set this to true for sites with many stories (say, over 10,000)');
ALTER TABLE topic_nexus_extras MODIFY COLUMN type ENUM('text', 'list') NOT NULL DEFAULT 'text';
# End of T_2_5_0_25, Start of T_2_5_0_26 - 2004/09/09
# If this next line throws an error saying there is no 'weight' column,
# that's OK, ignore it.
ALTER TABLE story_topics_rendered DROP COLUMN weight;
DROP TABLE IF EXISTS story_render_dirty;
CREATE TABLE story_render_dirty (
stoid MEDIUMINT UNSIGNED NOT NULL,
PRIMARY KEY (stoid)
) TYPE=InnoDB;
# End of T_2_5_0_26, Start of T_2_5_0_27 - 2004/09/14
ALTER TABLE skins ADD COLUMN ac_uid mediumint UNSIGNED DEFAULT '0' NOT NULL;
INSERT INTO vars (name, value, description) VALUES ('returnto_passwd',CONCAT('changeme', rand()),'Password used to sign MD5s for returnto URLs from remote sites');
ALTER TABLE topics ADD COLUMN submittable ENUM('no', 'yes') DEFAULT 'yes';
# If your 'allow_anonymous' var is 0, then replace __AC_UID__ with
# the value of your 'anonymous_coward_uid' var and do this.
INSERT INTO accesslist (uid, ipid, subnetid, ts, reason, now_nopost) values (__AC_UID__, NULL, NULL, NOW(), 'anonymous_coward_uid', 'yes');
# If it is 1, then do nothing. If you are using multiple anon cowards
# with skins.ac_uid, then add rows for those that should not be able to
# post. Yes, there will be an admin interface for this eventually.
# End of T_2_5_0_27, Start of T_2_5_0_28 - 2004/09/21
# End of T_2_5_0_28, Start of T_2_5_0_29 - 2004/09/28
# Changes for plugins/Admin (which you are almost certainly using)
DROP TABLE IF EXISTS uncommonstorywords;
CREATE TABLE uncommonstorywords (
word VARCHAR(255) NOT NULL,
PRIMARY KEY (word)
) TYPE=InnoDB;
# Run this perl script for each of your sites' virtual users
# perl -MSlash::Test=virtusername -e '@usw = split / /, $constants->{uncommonstorywords}; for $w (@usw) { $slashdb->sqlInsert("uncommonstorywords", { word => $w }) }'
DELETE FROM vars WHERE name='uncommonstorywords';
# need something here to convert exsect into extid data
# and losing the ' from extid and exaid data wouldn't be a bad idea either
# and maybe make them both params? that can probably wait
# then just edit users.pl and tildeEd templates.
ALTER TABLE users_index CHANGE COLUMN extid story_never_topic TEXT NOT NULL DEFAULT '', CHANGE COLUMN exaid story_never_author VARCHAR(255) NOT NULL DEFAULT '', CHANGE COLUMN exsect story_never_nexus VARCHAR(255) NOT NULL DEFAULT '', CHANGE COLUMN exboxes slashboxes TEXT NOT NULL DEFAULT '', ADD COLUMN story_always_topic TEXT NOT NULL DEFAULT '', ADD COLUMN story_always_author VARCHAR(255) NOT NULL DEFAULT '', ADD COLUMN story_always_nexus VARCHAR(255) NOT NULL DEFAULT '';
INSERT INTO string_param (type, code, name) VALUES ('story023','0','Never');
INSERT INTO string_param (type, code, name) VALUES ('story023','2','Often');
INSERT INTO string_param (type, code, name) VALUES ('story023','3','Always');
INSERT INTO vars (name, value, description) VALUES ('issue_lookback_days','90','Number of days to look back in issue mode');
# use of _29 is not recommended
# End of T_2_5_0_29, Start of T_2_5_0_30 - 2004/10/06
INSERT INTO vars (name, value, description) VALUES ('slashd_errnote_lastrun','','Last time slashd_errnote ran');
# Changed my mind :)
DELETE FROM string_param WHERE type='story023';
INSERT INTO string_param (type, code, name) VALUES ('story023','0','None');
INSERT INTO string_param (type, code, name) VALUES ('story023','2','Best');
INSERT INTO string_param (type, code, name) VALUES ('story023','3','All');
# run `perl utils/sectioncollapse_convert.plx VIRTUAL_USER`
# use of _30 is not recommended
# End of T_2_5_0_30, Start of T_2_5_0_31 - 2004/10/07
INSERT INTO vars (name, value, description) VALUES ('story_never_topic_allow','0','Allow story_never_topic data to be edited and passed to getStoriesEssentials? 0=no, 1=subscriber-only, 2=yes');
UPDATE users_index SET slashboxes = INSERT(slashboxes, LOCATE('index_more', slashboxes), LENGTH('index_more'), 'mainpage_more') WHERE LOCATE('index_more', slashboxes) > 0;
INSERT INTO vars (name, value, description) VALUES ('slashboxes_maxnum','25','Maximum number of slashboxes to allow');
DELETE FROM users_param WHERE value = 0 AND name IN ('clbig_bonus', 'clsmall_bonus', 'postanon', 'subscriber_bonus');
DELETE FROM users_param WHERE value ='+1' AND name IN ('karma_bonus');
DELETE FROM users_param WHERE value = 2 AND name IN ('domaintags');
# End of T_2_5_0_31, Start of T_2_5_0_32 - 2004/10/10
INSERT INTO vars (name, value, description) VALUES ('markup_checked_attribute',' CHECKED','The checked attribute that is used on the "input" HTML element, CHECKED for HTML 3.2 and checked="checked" for HTML 4.0 and beyond. Must include leading space!');
ALTER TABLE topic_nexus_extras ADD COLUMN required ENUM("no","yes") NOT NULL DEFAULT 'no';
ALTER TABLE topic_nexus_extras ADD COLUMN ordering TINYINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE topic_nexus_extras MODIFY COLUMN type ENUM('text', 'list', 'textarea') NOT NULL DEFAULT 'text';
INSERT INTO string_param (type, code, name) VALUES ('extra_types','text','Text');
INSERT INTO string_param (type, code, name) VALUES ('extra_types','textarea','Text Area');
INSERT INTO string_param (type, code, name) VALUES ('extra_types','list','List');
INSERT INTO string_param (type, code, name) VALUES ('extra_content_types','story','Story');
INSERT INTO string_param (type, code, name) VALUES ('extra_content_types','comment','Comment');
# End of T_2_5_0_32, Start of T_2_5_0_33 - 2004/10/12
############################################################
# If you are using MySQL 3.23.x, do not proceed beyond this
# point. MySQL 4.0.4 or later is required for T_2_5_0_33
# and later releases of Slash.
############################################################
INSERT INTO vars (name, value, description) VALUES ('ircslash','0','Enable the ircslash task and connect to an IRC channel whenever slashd starts');
INSERT INTO vars (name, value, description) VALUES ('ircslash_channel','#ircslash','Which channel to join');
INSERT INTO vars (name, value, description) VALUES ('ircslash_ircname','','Name to use on IRC server (defaults to "(slashsite) slashd")');
INSERT INTO vars (name, value, description) VALUES ('ircslash_lastremarktime','','Last time a remark was seen');
INSERT INTO vars (name, value, description) VALUES ('ircslash_nick','','Nick to use on IRC server (has a reasonable default)');
INSERT INTO vars (name, value, description) VALUES ('ircslash_port','6667','Port to use on IRC server');
INSERT INTO vars (name, value, description) VALUES ('ircslash_server','irc.slashnet.org','Which IRC server to connect to');
INSERT INTO vars (name, value, description) VALUES ('ircslash_ssl','0','Try to connect over SSL?');
INSERT INTO vars (name, value, description) VALUES ('ircslash_username','','Username to use on IRC server (has a reasonable default)');
DROP TABLE IF EXISTS remarks;
CREATE TABLE remarks (
uid mediumint UNSIGNED NOT NULL,
stoid MEDIUMINT UNSIGNED NOT NULL,
time DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL,
remark varchar(100),
INDEX uid (uid),
INDEX stoid (stoid),
INDEX time (time)
) TYPE=InnoDB;
INSERT INTO vars (name, value, description) VALUES ('task_timespec_freshenup', '* * * * *', 'Custom timespec (in cron style) for the freshenup task. Add more task_timespec_ vars if you want to override other task timespecs.');
ALTER TABLE skins ADD COLUMN searchable ENUM('no', 'yes') DEFAULT 'yes' NOT NULL AFTER submittable;
ALTER TABLE skins ADD COLUMN storypickable ENUM('no', 'yes') DEFAULT 'yes' NOT NULL AFTER searchable;
ALTER TABLE topics ADD COLUMN searchable ENUM('no', 'yes') DEFAULT 'yes' NOT NULL after submittable;
ALTER TABLE topics ADD COLUMN storypickable ENUM('no', 'yes') DEFAULT 'yes' NOT NULL after searchable;
INSERT INTO vars (name, value, description) VALUES ('freshenup_text_render_daysback','7','Oldest stories to write a story_text.rendered field for, in days');
# End of T_2_5_0_33, Start of T_2_5_0_34 - 2004/10/19
# Changes for plugins/Relocate (ignore if not using that plugin)
ALTER TABLE links DROP INDEX url_index;
ALTER TABLE links TYPE=InnoDB;
INSERT INTO vars (name, value, description) VALUES ('ircslash_channel_password','','Password for ircslash_channel');
INSERT INTO vars (name, value, description) VALUES ('users_count','1','(Approximate) number of users registered on this slash site');
DROP TABLE IF EXISTS users_count;
INSERT INTO vars (name, value, description) VALUES ('topic_popup_weights', '40=0|30=Mainpage|20=0|10=Sectional|0=0', 'The dividing lines etc. for the topic select box in the story editor');
# These next five changes should not be done if you have the Search plugin
# installed (you almost certainly do), on your _search_ database. If you
# have multiple databases, you might issue these commands on your master,
# and then check your slave DBs to see if your search DB or others had
# replication stopped by a (harmless) error. Restarting it is simple:
# "SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SLAVE START;"
# If you have only one DB, skip these next five lines (or just ignore
# their errors).
ALTER TABLE comments TYPE=InnoDB;
ALTER TABLE comment_text TYPE=InnoDB;
ALTER TABLE pollquestions TYPE=InnoDB;
ALTER TABLE story_text TYPE=InnoDB;
ALTER TABLE users TYPE=InnoDB;
# (We're going to change searching soon, so this last MyISAM requirement
# may go away. Stay tuned.)
# End of T_2_5_0_34, Start of T_2_5_0_35 - 2004/10/26
ALTER TABLE remarks ADD COLUMN rid mediumint UNSIGNED NOT NULL auto_increment PRIMARY KEY FIRST;
DELETE FROM vars WHERE name='ircslash_lastremarktime';
INSERT INTO vars (name, value, description) VALUES ('ircslash_lastremarkid','','Id of the last remark seen');
INSERT INTO vars (name, value, description) VALUES ('ircslash_remarks_delay','5','How often, in seconds, to poll for new remarks');
UPDATE vars SET name='ircslash_nextremarkid' WHERE name='ircslash_lastremarkid';
INSERT INTO vars (name, value, description) VALUES ('ircslash_remarks_max_day','10','How many remarks a single user can send, in a day, before we start ignoring them');
INSERT INTO vars (name, value, description) VALUES ('ircslash_remarks_max_month','20','How many remarks a single user can send, in a month, before we start ignoring them');
INSERT INTO vars (name, value, description) VALUES ('ircslash_remarks_max_year','100','How many remarks a single user can send, in a year, before we start ignoring them');
ALTER TABLE users_info ADD INDEX tokens (tokens);
ALTER TABLE users_comments ADD INDEX points (points);
# End of T_2_5_0_35, Start of T_2_5_0_36 - 2004/11/03
### DEFINE THESE!!
# set these vars to taste ... reasonable values for journal/search
# varities are the same as the normal ones
INSERT INTO vars (name, value, description) VALUES ('rdfitemdesc_html','0','1 == include HTML in item description; 0 == strip HTML (plain text only)');
INSERT INTO vars (name, value, description) VALUES ('journal_rdfitemdesc','0','1 == include introtext in item description; 0 == don\'t. Any other number is substr() of introtext to use');
INSERT INTO vars (name, value, description) VALUES ('journal_rdfitemdesc_html','0','1 == include HTML in item description; 0 == strip HTML (plain text only); 2 == HTML for subscribers only');
INSERT INTO vars (name, value, description) VALUES ('search_rdfitemdesc','0','1 == include introtext in item description; 0 == don\'t. Any other number is substr() of introtext to use');
INSERT INTO vars (name, value, description) VALUES ('search_rdfitemdesc_html','0','1 == include HTML in item description; 0 == strip HTML (plain text only)');
INSERT INTO vars (name, value, description) VALUES ('ircslash_remarks','0','Boolean - are remarks passed along or not?');
UPDATE pollquestions SET discussion=0 WHERE discussion IS NULL;
ALTER TABLE pollquestions CHANGE COLUMN discussion discussion mediumint UNSIGNED NOT NULL, ADD INDEX uid (uid), ADD INDEX discussion (discussion);
# End of T_2_5_0_36, Start of T_2_5_0_37 - 2004/11/08
INSERT INTO vars (name, value, description) VALUES ('mod_stats_lookback_days','30','Number of days to look back for repeat mods');
DROP TABLE IF EXISTS dbs_readerstatus;
CREATE TABLE dbs_readerstatus (
ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
dbid mediumint UNSIGNED NOT NULL,
was_alive enum("no","yes") DEFAULT "yes" NOT NULL,
was_reachable enum("no","yes") DEFAULT "yes",
was_running enum("no","yes") DEFAULT "yes",
slave_lag_secs float DEFAULT '0',
query_bog_secs float DEFAULT '0',
bog_rsqid mediumint UNSIGNED DEFAULT NULL,
KEY ts_dbid (ts, dbid),
KEY ts_bog (ts, bog_rsqid, query_bog_secs)
) TYPE=InnoDB;
DROP TABLE IF EXISTS dbs_readerstatus_queries;
CREATE TABLE dbs_readerstatus_queries (
rsqid mediumint UNSIGNED NOT NULL auto_increment,
text varchar(255),
PRIMARY KEY (rsqid),
KEY text (text)
) TYPE=InnoDB;
INSERT INTO vars (name, value, description) VALUES ('dbs_reader_adjust_delay','5','Number of seconds between each adjustment of reader DB weights');
INSERT INTO vars (name, value, description) VALUES ('dbs_reader_expire_secs', 86400 * 7,'Number of seconds worth of dbs_readerstatus log to keep around');
INSERT INTO vars (name, value, description) VALUES ('mod_token_assignment_delay', '2', 'Pause in seconds between batches of assigning token changes');
# End of T_2_5_0_37, Start of T_2_5_0_38 - 2004/11/16
ALTER TABLE submissions ADD COLUMN emaildomain varchar(255) DEFAULT '' NOT NULL AFTER email;
#perl -MSlash::Test=virtusername -le '$e = $slashdb->sqlSelectAllKeyValue("subid, email", "submissions"); for my $subid (sort { $a <=> $b } keys %$e) { $u = URI->new($e->{$subid}) or next; next unless $u->can("host"); $slashdb->sqlUpdate("submissions", { emaildomain => fullhost_to_domain($u->host()) }, "subid=$subid") }'
ALTER TABLE submissions ADD INDEX emaildomain (emaildomain);
INSERT INTO vars (name, value, description) VALUES ('submission_count_days','60','Number of days back to count submissions made by the same UID or domain');
ALTER TABLE dbs ADD COLUMN weight_adjust float UNSIGNED NOT NULL DEFAULT 1.0;
DELETE FROM vars WHERE name='search_db_user';
ALTER TABLE discussions ADD COLUMN archivable enum("no","yes") DEFAULT 'yes' NOT NULL;
UPDATE vars SET value=300 WHERE name='freshenup_max_stories';
# End of T_2_5_0_38, Start of T_2_5_0_39 - 2004/11/23
ALTER TABLE dbs ADD UNIQUE type_vu (type, virtual_user);
ALTER TABLE dbs_readerstatus ADD COLUMN had_weight tinyint UNSIGNED NOT NULL DEFAULT 1, ADD COLUMN had_weight_adjust float UNSIGNED NOT NULL default 1, DROP INDEX ts_bog;
INSERT INTO vars (name, value, description) VALUES ('dbs_reader_bog_secs_start','5','Number of seconds of reader DB bog at which balance_readers.pl should start to reduce its weight');
INSERT INTO vars (name, value, description) VALUES ('dbs_reader_bog_secs_end','60','Number of seconds of reader DB bog at which balance_readers.pl hits the minimum weight');
INSERT INTO vars (name, value, description) VALUES ('dbs_reader_bog_weight_min','0.2','The minimum weight to multiply a reader DB\'s base weight by once its bog hits dbs_reader_bog_secs_end');
INSERT INTO vars (name, value, description) VALUES ('dbs_reader_lag_secs_start','5','Number of seconds of reader DB lag at which balance_readers.pl should start to reduce its weight');
INSERT INTO vars (name, value, description) VALUES ('dbs_reader_lag_secs_end','30','Number of seconds of reader DB lag at which balance_readers.pl hits the minimum weight');
INSERT INTO vars (name, value, description) VALUES ('dbs_reader_lag_weight_min','0.1','The minimum weight to multiply a reader DB\'s base weight by once its lag hits dbs_reader_lag_secs_end');
INSERT INTO vars (name, value, description) VALUES ('dbs_reader_weight_reduce_max','2.0','The maximum number of units per minute to reduce weight down to the minimum');
INSERT INTO vars (name, value, description) VALUES ('dbs_reader_weight_increase_max','1.0','The maximum number of units per minute to restore weight back up to 1');
# run `perl utils/users_index_cleanup.plx VIRTUAL_USER`
ALTER TABLE submissions ADD INDEX time_emaildomain (time, emaildomain);
# End of T_2_5_0_39, Start of T_2_5_0_40 - 2004/11/24
DELETE FROM users_param WHERE name='sigdash';
# Extra var cleanup below. Deleting vars that are no longer used in Slash.
#
# Just to be on the safe side you may want to take a dump of all the vars being deleted. If any unexpected issues arise as a result
# you'll have a backup of the previous values.
#
# Replace values in CAPS with values appropriate for your environment
#
# mysqldump -u USER DATABASE -t vars -w 'name in ( "archive_use_backup_db", "comment_cache_debug", "comment_cache_max_keys", "comment_cache_newstyle",
# "comment_cache_purge_max_frac", "comment_cache_purge_min_comm", "comment_cache_purge_min_req", "currentqid", "daily_last", "daily_tz",
# "discussionrecycle", "get_titles", "m2_if_smoother", "m2_range_offset", "messages_send_maxsize", "mod_elig_hoursback", "paypal",
# "prepuser_backup_prob", "selectcomm_backup_prob", "siteowner", "submissions_listing_page_size", "subnet_karma_comments_needed", "test", "today", "zoo_process_limit", "zoo_timer")' > VAR_BACKUP.SQL
DELETE FROM vars where name in
( "archive_use_backup_db", "comment_cache_debug", "comment_cache_max_keys", "comment_cache_newstyle",
"comment_cache_purge_max_frac", "comment_cache_purge_min_comm", "comment_cache_purge_min_req", "currentqid", "daily_last", "daily_tz",
"discussionrecycle", "get_titles", "m2_if_smoother", "m2_range_offset", "messages_send_maxsize", "mod_elig_hoursback", "paypal",
"prepuser_backup_prob", "selectcomm_backup_prob", "siteowner", "submissions_listing_page_size", "subnet_karma_comments_needed", "test", "today", "zoo_process_limit", "zoo_timer");
# End of T_2_5_0_40, Start of T_2_5_0_41 - 2004/11/30
# End of T_2_5_0_41, Start of T_2_5_0_42 - 2004/12/07
INSERT INTO vars (name, value, description) VALUES ('ircslash_dbalert_bogthresh','30','Alert the IRC channel when DB query bog exceeds this value, in seconds, for the last minute average');
INSERT INTO vars (name, value, description) VALUES ('ircslash_dbalert_lagthresh','30','Alert the IRC channel when DB replication lag exceeds this value, in seconds, for the last minute average');
# End of T_2_5_0_42, Start of T_2_5_0_43 - 2004/12/14
INSERT INTO vars (name, value, description) VALUES ('dbsparklines_disp','0','Display dbsparklines in the currentAdminUsers box?');
INSERT INTO vars (name, value, description) VALUES ('dbsparklines_height',40,'Pixel height of sparkline graphs');
INSERT INTO vars (name, value, description) VALUES ('dbsparklines_pngsuffix',FLOOR(RAND()*900000000+100000000),'Random number to make it hard for unauthorized users to read these PNGs without permission');
INSERT INTO vars (name, value, description) VALUES ('dbsparklines_secsback',30*60,'How many seconds to look back for the sparklines');
INSERT INTO vars (name, value, description) VALUES ('dbsparklines_width',150,'Pixel width of sparkline graphs');
INSERT INTO vars (name, value, description) VALUES ('dbsparklines_ymax',20,'Max bog value (clip higher values to this)');
INSERT INTO vars (name, value, description) VALUES ('dbsparklines_ymin',-20,'Min lag value (clip lower values to this) - should be negative');
# End of T_2_5_0_43, Start of T_2_5_0_44 - 2005/01/04
# End of T_2_5_0_44, Start of T_2_5_0_45 - 2005/01/11
# End of T_2_5_0_45, Start of T_2_5_0_46 - 2005/01/18
# Your site almost certainly is using 6-hex-digit colors in the hexcolor
# fields, which should be prefixed with "#". If you want to use textual
# color names, change them (from e.g. "#000000" to "black") after the
# UPDATE below.
ALTER TABLE skin_colors CHANGE COLUMN hexcolor skincolor CHAR(12) DEFAULT '' NOT NULL;
UPDATE skin_colors SET skincolor=CONCAT("#", skincolor);
# Turn this on if you have a separate log_slave database
INSERT INTO vars (name, value, description) VALUES ('adminmail_check_replication', 0, 'Check replication if is caught up before starting adminmail');
# This only needs to be run on your log_slave DB
DROP TABLE IF EXISTS accesslog_build_unique_host_addr;
ALTER TABLE users MODIFY sig varchar(200);
# Change for plugins/HumanConf (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('hc_q1_linethick', '2', 'For question 1 (images), thickness of the lines that are drawn to confuse OCR');
# End of T_2_5_0_46, Start of T_2_5_0_47 - 2005/02/02
ALTER TABLE remarks ADD type ENUM("system","user") DEFAULT "user";
# These are only necessary if the Subscribe plugin is installed
INSERT INTO message_codes (code, type, seclev, modes, send, subscribe) VALUES (15, 'Subscription Running Low', 1, '', 'now', 1);
INSERT INTO message_codes (code, type, seclev, modes, send, subscribe) VALUES (16, 'Subscription Expired', 1, '', 'now', 1);
# End of T_2_5_0_47, Start of T_2_5_0_48 - 2005/02/08
# End of T_2_5_0_48, Start of T_2_5_0_49 - 2005/02/15
# End of T_2_5_0_49, Start of T_2_5_0_50 - 2005/02/22
INSERT INTO misc_user_opts (name, optorder, seclev, default_val, vals_regex, short_desc, long_desc, opts_html) VALUES ('disable_submit_bin_refresh',100,100,'0',NULL,'Disable bin refresh?','Do you want to disable refreshing the submissions bin?',NULL);
# End of T_2_5_0_50, Start of T_2_5_0_51 - 2005/03/01
# End of T_2_5_0_51, Start of T_2_5_0_52 - 2005/03/08
# End of T_2_5_0_52, Start of T_2_5_0_53 - 2005/03/15
INSERT INTO message_codes (code, type, seclev) VALUES (18, 'Invalid HTML Input', 100);
# Changes for plugins/Daypass (ignore if not using that plugin)
ALTER TABLE daypass_available ADD COLUMN minduration SMALLINT NOT NULL DEFAULT 0 AFTER adnum, ADD COLUMN aclreq VARCHAR(32) DEFAULT NULL;
ALTER TABLE daypass_keys ADD COLUMN earliest_confirmable DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER key_given;
INSERT INTO vars (name, value, description) VALUES ('daypass_adnum', '13', 'Which ad number to pass to getAd?');
INSERT INTO vars (name, value, description) VALUES ('daypass_offer_onlywhentmf', '0', 'Offer daypasses only when there is a story in The Mysterious Future?');
# End of T_2_5_0_53, Start of T_2_5_0_54 - 2005/03/29
INSERT INTO vars (name, value, description) VALUES ('daypass_tz', 'PST', 'What timezone are daypasses considered to be in (this determines where "midnight" starts and ends the day)');
# End of T_2_5_0_54, Start of T_2_5_0_55 - 2005/03/31
# Changes for plugins/Dilemma (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('dilemma_draw_graph_ticks', '100', 'Draw graph every this many ticks (roughly -- before this tickcount, draw every time; after 20x this tickcount, draw 1/3 as often');
ALTER TABLE dilemma_agents ADD COLUMN trid INT UNSIGNED NOT NULL AFTER daid, DROP INDEX alive, ADD INDEX trid_alive (trid, alive);
UPDATE dilemma_agents SET trid=1;
RENAME TABLE dilemma_info TO dilemma_tournament_info;
ALTER TABLE dilemma_tournament_info ADD COLUMN trid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST, CHANGE COLUMN alive active ENUM("no", "yes") DEFAULT "yes" NOT NULL, CHANGE COLUMN max_runtime max_tick INT UNSIGNED DEFAULT 1000 NOT NULL, CHANGE COLUMN food_per_time food_per_tick FLOAT UNSIGNED DEFAULT 1.0 NOT NULL, DROP COLUMN mean_meets, ADD COLUMN min_meets INT UNSIGNED DEFAULT 10 NOT NULL, ADD COLUMN max_meets INT UNSIGNED DEFAULT 30 NOT NULL, ADD COLUMN graph_drawn_tick INT UNSIGNED DEFAULT 0 NOT NULL;
UPDATE dilemma_tournament_info SET trid=1;
CREATE TABLE dilemma_stat_names ( dstnmid SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, name CHAR(16) NOT NULL, PRIMARY KEY (dstnmid) ) TYPE=InnoDB;
INSERT INTO dilemma_stat_names (dstnmid, name) VALUES (1, 'num_alive');
INSERT INTO dilemma_stat_names (dstnmid, name) VALUES (2, 'sumfood');
ALTER TABLE dilemma_stats ADD COLUMN trid INT UNSIGNED NOT NULL FIRST, CHANGE COLUMN tick tick INT UNSIGNED DEFAULT 0 NOT NULL, CHANGE COLUMN dsid dsid SMALLINT UNSIGNED DEFAULT 0 NOT NULL, ADD COLUMN dstnmid SMALLINT UNSIGNED DEFAULT 0 NOT NULL, DROP INDEX tick, DROP INDEX dsid, ADD UNIQUE ttdd (trid, tick, dsid, dstnmid), ADD INDEX tdd (trid, dsid, dstnmid);
UPDATE dilemma_stats SET trid=1;
UPDATE dilemma_stats SET dstnmid=1 WHERE name='num_alive';
UPDATE dilemma_stats SET dstnmid=2 WHERE name='sumfood';
ALTER TABLE dilemma_stats DROP COLUMN name;
ALTER TABLE dilemma_meetlog ADD COLUMN trid INT UNSIGNED NOT NULL AFTER meetid, DROP INDEX tick, ADD INDEX trid_tick (trid, tick);
UPDATE dilemma_meetlog SET trid=1;
# End of T_2_5_0_55, Start of T_2_5_0_56 - 2005/04/05
# Changes for plugins/Daypass (ignore if not using that plugin)
UPDATE vars SET value='60' WHERE name='daypass_cache_expire';
INSERT INTO vars (name, value, description) VALUES ('daypass_offer_method', '0', 'How to determine whether a daypass is offered: 0=use daypass_available table, 1=check adpos text against regex');
INSERT INTO vars (name, value, description) VALUES ('daypass_offer_method1_acl', '', 'ACL required to be offered a daypass (blank for none, i.e. all users eligible)');
INSERT INTO vars (name, value, description) VALUES ('daypass_offer_method1_adpos', '31', 'If daypass_offer_method is 1, which ad position to check?');
INSERT INTO vars (name, value, description) VALUES ('daypass_offer_method1_minduration', '10', 'Minimum time allowed before click');
INSERT INTO vars (name, value, description) VALUES ('daypass_offer_method1_regex', '!placeholder for ad position', 'If daypass_offer_method is 1, what regex on that ad text tells us that a daypass is available? A leading ! inverts logic (regex match means daypass not available)');
# End of T_2_5_0_56, Start of T_2_5_0_57 - 2005/04/08
#############
# be careful with below, make sure right for your site
# this is not required, but highly advised; it shouldn't have an adverse
# effect on most sites, but on sites that use alternative charsets ... dunno
UPDATE vars SET value = '1' WHERE name = 'draconian_charset';
# look at this carefully, make sure it has all the tags you want, and none you don't
# note that you cannot introduce new tags this way anymore, those must be added in
# the code directly, then *enabled* here
REPLACE INTO vars (name, value, description) VALUES ('approvedtags','b|i|p|br|a|ol|ul|li|dl|dt|dd|em|strong|tt|blockquote|div|ecode','Tags that you can use');
# we add N option and use it for alt
REPLACE INTO vars (name, value, description) VALUES ('approvedtags_attr', 'a:href_RU img:src_RU,alt_N,width,height,longdesc_U', 'definition of approvedtags attributes in the following format a:href_RU img:src_RU,alt,width,height,longdesc_U see Slash::Utility::Data.pm for more details');
# this should not need any modification
REPLACE INTO vars (name, value, description) VALUES ('approvedtags_break','p|br|ol|ul|li|dl|dt|dd|blockquote|div|img|hr|h1|h2|h3|h4|h5|h6','Tags that break words (see breakHtml())');
# this still won't be in effect unless sub or sup is in approvedtags, of course
INSERT INTO vars (name, value, description) VALUES ('nest_su_maxdepth','3','Maximum depth to which <SUP> and <SUB> tags can be nested');
# HTML is recommended, but if you are using XHTML, by all means, set this to 1
INSERT INTO vars (name, value, description) VALUES ('xhtml','0','Boolean for whether we are using XHTML');
#
#############
# End of T_2_5_0_57, Start of T_2_5_0_58 - 2005/04/13
# End of T_2_5_0_58, Start of T_2_5_0_59 - 2005/04/15
#############
# be careful with below, make sure right for your site
# add span, div, tables, and slash
INSERT INTO vars (name, value, description) VALUES ('approvedtags_attr_admin', 'div:id,class,title,style,dir,lang span:id,class,title,style,dir,lang slash:type_R,id,href_U,story,nickname,uid,user,align,width,height,title table:align,bgcolor,border,cellpadding,cellspacing,width tr:align,bgcolor,valign th:align,bgcolor,colspan,height,rowspan,valign,width td:align,bgcolor,colspan,height,rowspan,valign,width', 'see approvedtags_attr for more details');
#
#############
# End of T_2_5_0_59, Start of T_2_5_0_60 - 2005/04/15
CREATE TABLE al2 (
srcid BIGINT UNSIGNED NOT NULL DEFAULT '0',
value INT UNSIGNED NOT NULL DEFAULT '0',
updatecount INT UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (srcid)
) TYPE=InnoDB;
CREATE TABLE al2_log (
al2lid INT UNSIGNED NOT NULL AUTO_INCREMENT,
srcid BIGINT UNSIGNED NOT NULL DEFAULT '0',
ts DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
adminuid MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
al2tid TINYINT UNSIGNED NOT NULL DEFAULT '0',
val ENUM('set', 'clear') DEFAULT NULL,
PRIMARY KEY (al2lid),
INDEX ts (ts),
INDEX srcid_ts (srcid, ts)
) TYPE=InnoDB;
CREATE TABLE al2_log_comments (
al2lid INT UNSIGNED NOT NULL DEFAULT '0',
comment TEXT NOT NULL DEFAULT '',
PRIMARY KEY (al2lid)
) TYPE=InnoDB;
CREATE TABLE al2_types (
al2tid TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
bitpos TINYINT UNSIGNED DEFAULT NULL,
name VARCHAR(30) NOT NULL DEFAULT '',
title VARCHAR(64) NOT NULL DEFAULT '',
PRIMARY KEY (al2tid),
UNIQUE name (name),
UNIQUE bitpos (bitpos)
) TYPE=InnoDB;
INSERT INTO al2_types VALUES (1, NULL, 'comment', 'Comment');
INSERT INTO al2_types VALUES (2, 0, 'ban', 'Ban');
INSERT INTO al2_types VALUES (3, 1, 'expired', 'Expired');
INSERT INTO al2_types VALUES (4, 2, 'nopost', 'No Comment Post');
INSERT INTO al2_types VALUES (5, 3, 'nopalm', 'No Palm');
INSERT INTO al2_types VALUES (6, 4, 'norss', 'No RSS');
INSERT INTO al2_types VALUES (7, 5, 'nosubmit', 'No Story Submit');
INSERT INTO al2_types VALUES (8, 6, 'trusted', 'Trusted');
INSERT INTO al2_types VALUES (9, 7, 'proxy', 'Valid Proxy');
# run utils/accesslisttoal2 -u YOURSITEUSERNAME
# End of T_2_5_0_60, Start of T_2_5_0_61 - 2005/04/26
# End of T_2_5_0_61, Start of T_2_5_0_62 - 2005/04/28
REPLACE INTO vars (name, value, description) VALUES ('approvedtags_attr_admin', 'a:href_U,name,title div:id,class,title,style,dir,lang span:id,class,title,style,dir,lang slash:type_R,id,href_U,story,nickname,uid,user,align,width,height,title table:align,bgcolor,border,cellpadding,cellspacing,width tr:align,bgcolor,valign th:align,bgcolor,colspan,height,rowspan,valign,width td:align,bgcolor,colspan,height,rowspan,valign,width', 'inherits from approvedtags_attr');
# End of T_2_5_0_62, Start of T_2_5_0_63 - 2005/05/03
# End of T_2_5_0_63, Start of T_2_5_0_64 - 2005/05/10
# End of T_2_5_0_64, Start of T_2_5_0_65 - 2005/05/10
ALTER TABLE al2_log ADD INDEX al2tid_val_srcid (al2tid, val, srcid);
ALTER TABLE al2 ADD INDEX value (value);
# End of T_2_5_0_65, Start of T_2_5_0_66 - 2005/05/17
# Caution! "Update statements that refer to user variables
# (that is, variables of the form @var_name) are badly
# replicated in 3.23 and 4.0. This is fixed in 4.1."
# <http://dev.mysql.com/doc/mysql/en/replication-features.html>
# If you are running reader DBs, you will definitely want to
# check the al2_types table after the following command has
# replicated to see if the data is correct.
SELECT @maxbitpos := MAX(bitpos) FROM al2_types;
INSERT INTO al2_types VALUES (NULL, @maxbitpos+1, 'nopostanon', 'No Comment Post Anon');
# add class/style for table elements, for convenience
REPLACE INTO vars (name, value, description) VALUES ('approvedtags_attr_admin', 'a:href_U,name,title div:id,class,title,style,dir,lang span:id,class,title,style,dir,lang slash:type_R,id,href_U,story,nickname,uid,user,align,width,height,title table:align,bgcolor,border,cellpadding,cellspacing,width,style,class tr:align,bgcolor,valign,style,class th:align,bgcolor,colspan,height,rowspan,valign,width,style,class td:align,bgcolor,colspan,height,rowspan,valign,width,style,class', 'inherits from approvedtags_attr');
INSERT INTO vars (name, value, description) VALUES ('comments_anon_speed_limit','0','seconds delay before repeat posting for anonymous user. If 0 uses defaults to speed_limit for all users');
INSERT INTO vars (name, value, description) VALUES ('comments_anon_speed_limit_mult','1', 'Multiply speedlimit by this amount for each comment previously posted in the past 24 hours');
# Jabber support for ircslash
INSERT INTO vars (name, value, description) VALUES ('jabberslash','0','Enable the ircslash task for Jabber, and connect to a Jabber channel whenever slashd starts');
INSERT INTO vars (name, value, description) VALUES ('jabberslash_channel','jabberslash','Which channel to join');
INSERT INTO vars (name, value, description) VALUES ('jabberslash_channel_password','','Password for jabberslash_channel');
INSERT INTO vars (name, value, description) VALUES ('jabberslash_channel_server','jabberslash','Which Jabber server to use for the channel (defaults to jabberslash_server)');
INSERT INTO vars (name, value, description) VALUES ('jabberslash_ircname','','Account name to use on Jabber server (defaults to "(slashsite) slashd")');
INSERT INTO vars (name, value, description) VALUES ('jabberslash_nick','','Nick to use on IRC server (has a reasonable default); is used for jabber Resource and channel alias');
INSERT INTO vars (name, value, description) VALUES ('jabberslash_password','','Password for jabberslash_ircname account');
INSERT INTO vars (name, value, description) VALUES ('jabberslash_port','5222','Port to use on Jabber server');
INSERT INTO vars (name, value, description) VALUES ('jabberslash_server','jabber.org','Which Jabber server to connect to');
INSERT INTO vars (name, value, description) VALUES ('jabberslash_tls','0','Try to connect using TLS?');
INSERT INTO vars (name, value, description) VALUES ('ircslash_jabber_users','','Pipe-separated list of userids ("userid" or "userid/resource") to send Jabber messages to, instead of sending to channel');
INSERT INTO vars (name, value, description) VALUES ('ircslash_lcr_sites','','Pipe-separated list of site names to use for lcr cmd');
# End of T_2_5_0_66, Start of T_2_5_0_67 - 2005/05/24
# End of T_2_5_0_67, Start of T_2_5_0_68 - 2005/05/28
ALTER TABLE open_proxies ADD COLUMN dur FLOAT DEFAULT NULL AFTER port;
# End of T_2_5_0_68, Start of T_2_5_0_69 - 2005/05/31
# Changes for plugins/HumanConf (ignore if not using that plugin)
UPDATE vars SET description='HumanConf switch for posting comments: 0=off, 1=anon only, 2=also logged-in with low karma' WHERE name='hc_sw_comments';
# End of T_2_5_0_69, Start of T_2_5_0_70 - 2005/06/01
# End of T_2_5_0_70, Start of T_2_5_0_71 - 2005/06/07
INSERT INTO vars (name, value, description) VALUES ('formkey_minloggedinkarma','1','The min karma a user must have to "count" as a logged-in user for some purposes');
ALTER TABLE open_proxies CHANGE COLUMN xff xff VARCHAR(40) DEFAULT NULL;
# Changes for plugins/HumanConf (ignore if not using that plugin)
INSERT INTO vars (name, value, description) VALUES ('hc_q1_lettersomit', 'hlou', 'For question 1 (images), which letters should never appear? Lowercase');
# End of T_2_5_0_72, Start of T_2_5_0_73 - 2005/06/14
# End of T_2_5_0_73, Start of T_2_5_0_74 - 2005/06/21
# End of T_2_5_0_74, Start of T_2_5_0_75 - 2005/06/28
# Changes for plugins/HumanConf (ignore if not using that plugin)
# and if you use the first, you may want to customize the second
INSERT INTO vars (name, value, description) VALUES ('hc_q1_usedict', '', 'For question 1 (images), use words from a dictionary? if blank, no; otherwise, value is the absolute path to the newline-delimited file e.g. /usr/dict/words and hc_q1_lettersomit is ignored');
INSERT INTO vars (name, value, description) VALUES ('hc_q1_usedict_excl', 'shiny$ metal ^daffodil', 'If hc_q1_usedict is set, space-sep list of regexes to exclude from words to use');
INSERT INTO vars (name, value, description) VALUES ('hc_q1_linecloseness', '8', 'For question 1 (images), closeness of the lines drawn over the letters, higher means more density');
# SLASHCLUSTER LAST UPDATED HERE
# End of T_2_5_0_75, Start of T_2_5_0_76 - 2005/07/20
INSERT INTO vars (name, value, description) VALUES ('ssihead_inc_pages', 'article', 'Pages that should always use their own .inc for ssihead');
INSERT INTO vars (name, value, description) VALUES ('css_expire','3600','Time in seconds before css cache expires');
CREATE TABLE css_type (
ctid TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(32) NOT NULL DEFAULT '',
ordernum TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (ctid)
) TYPE=InnoDB;
CREATE TABLE css (
csid int(11) NOT NULL AUTO_INCREMENT,
rel VARCHAR(32) DEFAULT 'stylesheet',
type VARCHAR(32) DEFAULT 'text/css',
media VARCHAR(32) DEFAULT 'screen, projection',
file VARCHAR(64),
title VARCHAR(32),
skid INT(11) DEFAULT '0',
page VARCHAR(32) DEFAULT '',
admin ENUM('no','yes') DEFAULT 'no',
theme VARCHAR(32) DEFAULT '',
ctid TINYINT(4) NOT NULL DEFAULT '0',
ordernum int(11) DEFAULT '0',
ie_cond VARCHAR(16) DEFAULT '',
PRIMARY KEY (csid),
KEY ctid (ctid),
KEY page_skid (page,skid),
KEY skid_page (skid,page)
) TYPE=InnoDB;
INSERT INTO css_type (ctid, name, ordernum) VALUES (1,'base',1);
INSERT INTO css_type (ctid, name, ordernum) VALUES (2,'page',2);
INSERT INTO css_type (ctid, name, ordernum) VALUES (3,'theme',3);
INSERT INTO css_type (ctid, name, ordernum) VALUES (4,'user_theme',4);
INSERT INTO css_type (ctid, name, ordernum) VALUES (5,'print',5);
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','screen, projection','base.css','Slashcode',0,'','no','',1,0);
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','screen, projection','comments.css','Slashcode',0,'comments','no','',2,0);
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','screen, projection','comments.css','Slashcode',0,'article','no','',2,0);
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','print','print.css','Print',0,'','no','',5,0);
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','screen, projection','admin.css','Slashcode',0,'','yes','',1,0);
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','screen, projection','comments.css','Slashcode',0,'pollBooth','no','',2,0);
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','screen, projection','slashcode_lite.css','Slashcode',0,'','no','light',4,0);
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','screen, projection','comments.css','Slashcode',0,'journal','no','',2,0);
# Run this only if you don't already have this CSS file already in the table or whatever theme you may be using instead
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','screen, projection','slashcode.css','Slashcode',0,'','no','',3,0);
# Caution! "Update statements that refer to user variables
# (that is, variables of the form @var_name) are badly
# replicated in 3.23 and 4.0. This is fixed in 4.1."
# <http://dev.mysql.com/doc/mysql/en/replication-features.html>
# If you are running reader DBs, you will definitely want to
# check the css table after the following command has
# replicated to see if the data is correct.
SELECT @page_ctid := ctid FROM css_type where name="page";
# Run this only if you have search installed and don't
# currently have this line in your css file
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','screen, projection','search.css','Slashcode',0,'search','no','',@page_ctid,0);
# Run this only if you have pollBooth installed and
# don't currently have this line in your css file
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','screen, projection','polls.css','Slashcode',0,'pollBooth','no','',@page_ctid,0);
UPDATE css set title="" where file="print.css";
DELETE FROM vars where name = 'ssihead_inc_pages';
# run this unless you have a reason not to (like, you have your own html;article;default)
DELETE FROM templates WHERE name = 'header' AND skin = 'default' AND page='article';
UPDATE vars set description="Time in seconds before css cache expires" where name="css_expire";
INSERT INTO vars (name, value, description) VALUES ('feed_types', 'rss|atom', 'Feed types allowed.');
# End of T_2_5_0_76, Start of T_2_5_0_77 - 2005/07/27
UPDATE css_type SET ordernum = 6 where name="print";
UPDATE css_type SET ordernum = 5 where name="user_theme";
INSERT INTO css_type (ctid, name, ordernum) VALUES (6,'skin',4);
INSERT INTO vars (name, value, description) VALUES ('accesslog_css_skip', '1', 'Skip logging css hits to accesslog table?');
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','screen, projection','comments.css','Slashcode',0,'metamod','no','',2,0);
INSERT INTO vars (name, value, description) VALUES ('users_menu_no_display', '0', 'Hide users menu?');
# End of T_2_5_0_77, Start of T_2_5_0_78 - 2005/08/25
# Changes for plugins/ScheduleShifts (ignore if not using that plugin,
# and you almost certainly are not using it)
ALTER TABLE shifts TYPE=InnoDB;
# End of T_2_5_0_78, Start of T_2_5_0_79 - 2005/09/01
# Double check before running this. No title is best unless you know you need a title on something custom you set up.
UPDATE css set title='';
INSERT INTO css (rel, type, media, file, title, skid, page, admin, theme, ctid, ordernum) VALUES ('stylesheet','text/css','handheld','handheld.css','',0,'','no','',7,0);
INSERT INTO css_type (ctid, name, ordernum) VALUES (7, 'handheld', 7);
# Verify you want to delete these. They are no longer needed by default slashcode theme, but may be needed if you have this template in your theme
DELETE FROM templates WHERE name = "dispComment" AND page = "misc" AND skin = "light";
DELETE FROM templates WHERE name = "dispStory" AND page = "misc" AND skin = "light";
DELETE FROM templates WHERE name = "fancybox" AND page = "misc" AND skin = "light";
DELETE FROM templates WHERE name = "storylink" AND page = "misc" AND skin = "light";
DELETE FROM templates WHERE name = "titlebar" AND page = "misc" AND skin = "light";
ALTER TABLE css ADD skin VARCHAR(32) DEFAULT ''AFTER skid;
ALTER TABLE css DROP INDEX page_skid;
ALTER TABLE css DROP INDEX skid_page;
UPDATE css,skins SET css.skin = skins.name WHERE css.skid=skins.skid;
ALTER TABLE css DROP skid;
ALTER TABLE css ADD INDEX page_skin (page,skin);
ALTER TABLE css ADD INDEX skin_page (skin,page);
UPDATE css set theme='', skin='light' WHERE theme = "light";
# End of T_2_5_0_79, Start of T_2_5_0_80 - 2005/09/19
# End of T_2_5_0_80, Start of T_2_5_0_81 - 2005/09/21
ALTER TABLE dbs_readerstatus CHANGE COLUMN had_weight had_weight tinyint UNSIGNED DEFAULT 1, CHANGE COLUMN had_weight_adjust had_weight_adjust float UNSIGNED DEFAULT 1;
# End of T_2_5_0_81, Start of T_2_5_0_82 - 2005/09/23
# Changes for plugins/Admin (which you are almost certainly using)
INSERT INTO vars (name, value, description) VALUES ('ispell_is_really_aspell_with_lang', '', 'Some systems install aspell and a script that mimics the behavior of ispell; if yours does, set this to your preferred language name, e.g. "english"');
DROP TABLE IF EXISTS accesslist;
# End of T_2_5_0_82, Start of T_2_5_0_83 - 2005/09/27
INSERT INTO vars (name, value, description) VALUES ('cvs_tag_currentcode','T_2_5_0_82','The current cvs tag that the code was updated to - this does not affect site behavior but may be useful for your records');
# You almost certainly want to install the plugin ResKey at this point.
# Changes for plugins/ResKey (which you should be using)
INSERT INTO vars VALUES ('reskey_checks_duration_max-failures_zoo', 4, 'how many failures per reskey');
INSERT INTO vars VALUES ('reskey_checks_duration_max-failures_comments', 10, 'how many failures per reskey');
UPDATE vars SET value = 'T_2_5_0_83' WHERE name = 'cvs_tag_currentcode';
# End of T_2_5_0_83, Start of T_2_5_0_84 - 2005/10/04
# Install MIME::Types if any of your Slash sites are using the Blob plugin.
# Changes for plugins/Daypass
ALTER TABLE daypass_keys DROP INDEX uid_daypasskey;
ALTER TABLE daypass_keys DROP COLUMN uid, ADD COLUMN daid SMALLINT UNSIGNED NOT NULL DEFAULT 0 AFTER daypasskey;
ALTER TABLE daypass_keys ADD UNIQUE INDEX daypasskey (daypasskey);
CREATE TABLE daypass_confcodes (
confcode CHAR(20) NOT NULL DEFAULT '',
gooduntil DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY confcode (confcode)
) TYPE=InnoDB;
DROP TABLE daypass_users;
INSERT INTO vars (name, value, description) VALUES ('cvs_tag_currentcode_emit','1','Emit cvs_tag_currentcode revision number in the X-Powered-By header. If you are paranoid or believe in security through obscurity feel free to leave this false, but in the event of a security hole it may help us contact you');
# Changes for plugins/ResKey (which you should be using)
INSERT IGNORE INTO vars VALUES ('reskey_srcid_masksize', 24, 'which srcid mask size to use for reskeys');
INSERT IGNORE INTO vars VALUES ('reskey_timeframe', 14400, 'Default timeframe base to use for max-uses (in seconds)');
INSERT IGNORE INTO reskey_resources VALUES (1, 'comments');
INSERT IGNORE INTO reskey_resources VALUES (2, 'zoo');
INSERT INTO reskey_resources VALUES (3, 'journal');
INSERT INTO reskey_resources VALUES (4, 'journal-soap');
### do this, but be careful, if you've changed the defaults, to note those changes
DELETE FROM vars WHERE name LIKE 'reskey_checks_%';
DROP TABLE IF EXISTS reskey_vars;
CREATE TABLE reskey_vars (
rkrid TINYINT UNSIGNED NOT NULL,
name VARCHAR(48) DEFAULT '' NOT NULL,
value TEXT,
description VARCHAR(255),
UNIQUE name_rkrid (name, rkrid)
) TYPE=InnoDB;
##### comments
### checks
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 1, 'all', 'Slash::ResKey::Checks::User', 101);
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 1, 'all', 'Slash::ResKey::Checks::ACL', 201);
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 1, 'all', 'Slash::ResKey::Checks::AL2::AnonNoPost', 301);
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 1, 'all', 'Slash::ResKey::Checks::AL2::NoPostAnon', 401);
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 1, 'all', 'Slash::ResKey::Checks::AL2::NoPost', 501);
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 1, 'all', 'Slash::ResKey::Checks::Duration', 601);
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 1, 'use', 'Slash::ResKey::Checks::ProxyScan', 1001);
### vars
INSERT INTO reskey_vars VALUES (1, 'adminbypass', 1, 'If admin, bypass checks for duration, proxy, and user');
INSERT INTO reskey_vars VALUES (1, 'acl_no', 'reskey_no_comments', 'If this ACL present, can\'t use resource');
INSERT INTO reskey_vars VALUES (1, 'user_seclev', 0, 'Minimum seclev to use resource');
INSERT INTO reskey_vars VALUES (1, 'user_karma', '', 'No minimum karma to use resource');
INSERT INTO reskey_vars VALUES (1, 'duration_max-uses', 30, 'how many uses per timeframe');
INSERT INTO reskey_vars VALUES (1, 'duration_max-failures', 10, 'how many failures per reskey');
INSERT INTO reskey_vars VALUES (1, 'duration_uses', 120, 'min duration (in seconds) between uses');
INSERT INTO reskey_vars VALUES (1, 'duration_creation-use', 5, 'min duration between (in seconds) creation and use');
##### zoo
### checks
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 2, 'all', 'Slash::ResKey::Checks::User', 101);
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 2, 'all', 'Slash::ResKey::Checks::ACL', 201);
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 2, 'all', 'Slash::ResKey::Checks::AL2::AnonNoPost', 301);
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 2, 'all', 'Slash::ResKey::Checks::AL2::NoPostAnon', 401);
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 2, 'all', 'Slash::ResKey::Checks::AL2::NoPost', 501);
INSERT IGNORE INTO reskey_resource_checks VALUES (NULL, 2, 'all', 'Slash::ResKey::Checks::Duration', 601);
### vars
INSERT INTO reskey_vars VALUES (2, 'adminbypass', 1, 'If admin, bypass checks for duration, proxy, and user');
INSERT INTO reskey_vars VALUES (2, 'acl_no', 'reskey_no_zoo', 'If this ACL present, can\'t use resource');
INSERT INTO reskey_vars VALUES (2, 'user_seclev', 1, 'Minimum seclev to use resource');
INSERT INTO reskey_vars VALUES (2, 'duration_max-uses', 30, 'how many uses per timeframe');
INSERT INTO reskey_vars VALUES (2, 'duration_max-failures', 4, 'how many failures per reskey');
INSERT INTO reskey_vars VALUES (2, 'duration_uses', 2, 'min duration (in seconds) between uses');
INSERT INTO reskey_vars VALUES (2, 'duration_creation-use', 2, 'min duration (in seconds) between creation and use');
##### journal
### checks
INSERT INTO reskey_resource_checks VALUES (NULL, 3, 'all', 'Slash::ResKey::Checks::User', 101);
INSERT INTO reskey_resource_checks VALUES (NULL, 3, 'all', 'Slash::ResKey::Checks::ACL', 201);
INSERT INTO reskey_resource_checks VALUES (NULL, 3, 'all', 'Slash::ResKey::Checks::AL2::AnonNoPost', 301);
INSERT INTO reskey_resource_checks VALUES (NULL, 3, 'all', 'Slash::ResKey::Checks::AL2::NoPostAnon', 401);
INSERT INTO reskey_resource_checks VALUES (NULL, 3, 'all', 'Slash::ResKey::Checks::AL2::NoPost', 501);
INSERT INTO reskey_resource_checks VALUES (NULL, 3, 'all', 'Slash::ResKey::Checks::Duration', 601);
### vars
INSERT INTO reskey_vars VALUES (3, 'adminbypass', 1, 'If admin, bypass checks for duration, proxy, and user');
INSERT INTO reskey_vars VALUES (3, 'acl_no', 'reskey_no_journal', 'If this ACL present, can\'t use resource');
INSERT INTO reskey_vars VALUES (3, 'user_seclev', 1, 'Minimum seclev to use resource');
INSERT INTO reskey_vars VALUES (3, 'duration_max-uses', 30, 'how many uses per timeframe');
INSERT INTO reskey_vars VALUES (3, 'duration_max-failures', 10, 'how many failures per reskey');
INSERT INTO reskey_vars VALUES (3, 'duration_uses', 30, 'min duration (in seconds) between uses');
INSERT INTO reskey_vars VALUES (3, 'duration_creation-use', 2, 'min duration (in seconds) between creation and use');
##### journal-soap
### checks
INSERT INTO reskey_resource_checks VALUES (NULL, 4, 'all', 'Slash::ResKey::Checks::User', 101);
INSERT INTO reskey_resource_checks VALUES (NULL, 4, 'all', 'Slash::ResKey::Checks::ACL', 201);
INSERT INTO reskey_resource_checks VALUES (NULL, 4, 'all', 'Slash::ResKey::Checks::AL2::AnonNoPost', 301);
INSERT INTO reskey_resource_checks VALUES (NULL, 4, 'all', 'Slash::ResKey::Checks::AL2::NoPostAnon', 401);
INSERT INTO reskey_resource_checks VALUES (NULL, 4, 'all', 'Slash::ResKey::Checks::AL2::NoPost', 501);
INSERT INTO reskey_resource_checks VALUES (NULL, 4, 'all', 'Slash::ResKey::Checks::Duration', 601);
### vars
INSERT INTO reskey_vars VALUES (4, 'adminbypass', 1, 'If admin, bypass checks for duration, proxy, and user');
INSERT INTO reskey_vars VALUES (4, 'acl_no', 'reskey_no_journal', 'If this ACL present, can\'t use resource');
INSERT INTO reskey_vars VALUES (4, 'user_seclev', 1, 'Minimum seclev to use resource');
INSERT INTO reskey_vars VALUES (4, 'duration_max-uses', 30, 'how many uses per timeframe');
INSERT INTO reskey_vars VALUES (4, 'duration_max-failures', 10, 'how many failures per reskey');
INSERT INTO reskey_vars VALUES (4, 'duration_uses', 30, 'min duration (in seconds) between uses');
UPDATE vars SET value = 'T_2_5_0_84' WHERE name = 'cvs_tag_currentcode';
# End of T_2_5_0_84, Start of T_2_5_0_85 - 2005/10/11
# Changes for plugins/ResKey (which you should be using)
ALTER TABLE reskeys CHANGE COLUMN reskey reskey CHAR(20) DEFAULT '' NOT NULL, TYPE=InnoDB;
ALTER TABLE reskey_resources TYPE=InnoDB;
ALTER TABLE reskey_resource_checks TYPE=InnoDB;
# we only want this for comments, though you may wish it for other things ...
DELETE FROM reskey_resource_checks WHERE class = 'Slash::ResKey::Checks::ProxyScan';
DROP TABLE IF EXISTS reskey_failures;
CREATE TABLE reskey_failures (
rkid INT NOT NULL,
failure VARCHAR(255) DEFAULT '' NOT NULL,
PRIMARY KEY (rkid)
) TYPE=InnoDB;
INSERT INTO reskey_resources VALUES (5, 'pollbooth');
##### pollbooth
### checks
INSERT INTO reskey_resource_checks VALUES (NULL, 5, 'all', 'Slash::ResKey::Checks::User', 101);
INSERT INTO reskey_resource_checks VALUES (NULL, 5, 'all', 'Slash::ResKey::Checks::ACL', 201);
INSERT INTO reskey_resource_checks VALUES (NULL, 5, 'all', 'Slash::ResKey::Checks::AL2::AnonNoPost', 301);
INSERT INTO reskey_resource_checks VALUES (NULL, 5, 'all', 'Slash::ResKey::Checks::AL2::NoPostAnon', 401);
INSERT INTO reskey_resource_checks VALUES (NULL, 5, 'all', 'Slash::ResKey::Checks::AL2::NoPost', 501);
INSERT INTO reskey_resource_checks VALUES (NULL, 5, 'all', 'Slash::ResKey::Checks::Duration', 601);
### vars
INSERT INTO reskey_vars VALUES (5, 'adminbypass', 1, 'If admin, bypass checks for duration, proxy, and user');
INSERT INTO reskey_vars VALUES (5, 'acl_no', 'reskey_no_pollbooth', 'If this ACL present, can\'t use resource');
INSERT INTO reskey_vars VALUES (5, 'duration_max-uses', 10, 'how many uses per timeframe');
INSERT INTO reskey_vars VALUES (5, 'duration_max-failures', 3, 'how many failures per reskey');
INSERT INTO reskey_vars VALUES (5, 'duration_uses', 10, 'min duration (in seconds) between uses');
INSERT INTO reskey_vars VALUES (5, 'duration_creation-use', 2, 'min duration (in seconds) between creation and use');
ALTER TABLE css ADD ie_cond VARCHAR(16) DEFAULT '';
UPDATE vars SET value = 'T_2_5_0_85' WHERE name = 'cvs_tag_currentcode';
# End of T_2_5_0_85, Start of T_2_5_0_86 - 2005/10/18
DELETE FROM reskey_vars WHERE rkrid=5 AND name='duration_creation-use';
INSERT INTO reskey_resource_checks VALUES (NULL, 5, 'use', 'Slash::ResKey::Checks::Post', 151);
INSERT INTO reskey_resource_checks VALUES (NULL, 5, 'all', 'Slash::PollBooth::ResKey', 251);
INSERT INTO vars (name, value, description) VALUES ('lowbandwidth_bids_regex','_more$','bids we want to show in low bandwidth mode. NONE if we don\'t want to show any');
ALTER TABLE css ADD lowbandwidth ENUM("no","yes") DEFAULT "no";
# Caution! "Update statements that refer to user variables
# (that is, variables of the form @var_name) are badly
# replicated in 3.23 and 4.0. This is fixed in 4.1."
# <http://dev.mysql.com/doc/mysql/en/replication-features.html>
# If you are running reader DBs, you will definitely want to
# check the css table after the following command has
# replicated to see if the data is correct.
#
# Or if you want to be safe just do the select manually and replace
# @ut_ctid with the result of the select
SELECT @ut_ctid := ctid FROM css_type where name="user_theme";
INSERT INTO css (rel, type, media, file, title, skin, page, admin, theme, ctid, ordernum, ie_cond, lowbandwidth) VALUES ('stylesheet','text/css','screen, projection','slashcode_low_bw.css','','','','no','',@ut_ctid, 99, "", "yes");
# Removing light section templates. Light as a section no longer exists so these can go.
DELETE FROM templates where skin="light";
# Run this perl script for each of your sites' virtual users. This will set all users with light mode turned on to have
# simpledesign and lowbandwidth settings turned on initially
# Replace virtusername with the virtual user for your site
# perl -MSlash::Test=virtusername -e 'my $uids = $slashdb->sqlSelectColArrayref("uid","users_prefs","light=1"); $slashdb->setUser($_, {simpledesign => 1, lowbandwidth => 1}) foreach @$uids;'
UPDATE css set theme="light", skin="" WHERE file="slashcode_lite.css";
# 2005-10-26
UPDATE vars SET value = 'T_2_5_0_86' WHERE name = 'cvs_tag_currentcode';
# You should update all your THEME and PLUGIN files to use css= instead of htdoc= for .css files that are managed through the site's css table
INSERT INTO vars (name, value, description) VALUES ('css_use_imagedir','0','Place .css files in imagedir instead for your rootdir? You may want to utilize this if you are using boa or another lightweight webserver to serve images. Run symlink-tool after switching var');
# If users_acl has a foreign key on users.uid, or journals has one to
# topics.tid, now's a good time to drop them. We're not providing SQL
# for that because I don't think there's a good programmatic way to
# determine the name of those keys.
# plugins/Journal (ignore if not using that plugin)
ALTER TABLE journals ADD INDEX uid_date_id (uid, date, id);
INSERT INTO reskey_resources VALUES (6, 'submit');
INSERT INTO reskey_resources VALUES (7, 'journal-soap-get');
##### submit
### checks
INSERT INTO reskey_resource_checks VALUES (NULL, 6, 'all', 'Slash::ResKey::Checks::User', 101);
INSERT INTO reskey_resource_checks VALUES (NULL, 6, 'use', 'Slash::ResKey::Checks::Post', 151);
INSERT INTO reskey_resource_checks VALUES (NULL, 6, 'all', 'Slash::ResKey::Checks::ACL', 201);
INSERT INTO reskey_resource_checks VALUES (NULL, 6, 'all', 'Slash::ResKey::Checks::AL2::AnonNoPost', 301);
INSERT INTO reskey_resource_checks VALUES (NULL, 6, 'all', 'Slash::ResKey::Checks::AL2::NoPostAnon', 401);
INSERT INTO reskey_resource_checks VALUES (NULL, 6, 'all', 'Slash::ResKey::Checks::AL2::NoPost', 501);
INSERT INTO reskey_resource_checks VALUES (NULL, 6, 'all', 'Slash::ResKey::Checks::Duration', 601);
### vars
INSERT INTO reskey_vars VALUES (6, 'adminbypass', 1, 'If admin, bypass checks for duration, proxy, and user');
INSERT INTO reskey_vars VALUES (6, 'acl_no', 'reskey_no_submit', 'If this ACL present, can\'t use resource');
INSERT INTO reskey_vars VALUES (6, 'duration_max-uses', 20, 'how many uses per timeframe');
INSERT INTO reskey_vars VALUES (6, 'duration_max-failures', 10, 'how many failures per reskey');
INSERT INTO reskey_vars VALUES (6, 'duration_uses', 300, 'min duration (in seconds) between uses');
INSERT INTO reskey_vars VALUES (6, 'duration_creation-use', 20, 'min duration (in seconds) between creation and use');
##### journal-soap-get
### checks
INSERT INTO reskey_resource_checks VALUES (NULL, 7, 'all', 'Slash::ResKey::Checks::User', 101);
INSERT INTO reskey_resource_checks VALUES (NULL, 7, 'all', 'Slash::ResKey::Checks::ACL', 201);
INSERT INTO reskey_resource_checks VALUES (NULL, 7, 'all', 'Slash::ResKey::Checks::Duration', 601);
### vars
INSERT INTO reskey_vars VALUES (7, 'adminbypass', 1, 'If admin, bypass checks for duration, proxy, and user');
#INSERT INTO reskey_vars VALUES (7, 'acl', 'reskey_journal-soap', 'If this ACL present, can use resource');
INSERT INTO reskey_vars VALUES (7, 'acl_no', 'reskey_no_journal', 'If this ACL present, can\'t use resource');
#INSERT INTO reskey_vars VALUES (7, 'user_is_subscriber', 1, 'Require user to be subscriber');
INSERT INTO reskey_vars VALUES (7, 'duration_max-failures', 1, 'how many failures per reskey');
# 2005-11-01
UPDATE vars SET value = 'T_2_5_0_87' WHERE name = 'cvs_tag_currentcode';
# This was omitted from PollBooth mysql_dump earlier; do this only if you
# have PollBooth installed. It may or may not do anything, which is OK.
INSERT IGNORE INTO vars (name, value, description) VALUES ('allow_anon_poll_voting', '1', 'Set this to decide whether anonymous users can vote in polls)');
INSERT INTO reskey_resource_checks VALUES (NULL, 6, 'all', 'Slash::ResKey::Checks::AL2::NoSubmit', 551);
# 2005-11-09
UPDATE vars SET value = 'T_2_5_0_88' WHERE name = 'cvs_tag_currentcode';
UPDATE vars SET description='Should we be saving incoming submissions for rss' WHERE name='rss_store';
UPDATE vars SET name='rss_max_items_incoming', description='Max number of rss items shown in a slashbox, by default' WHERE name='max_items';
INSERT INTO vars (name, value, description) VALUES ('rss_max_items_outgoing','10','Max number of rss items emitted in an rss/rdf/atom feed');
# Add the following if you have the Journal plugin installed
ALTER TABLE journals ADD submit ENUM ("no", "yes") DEFAULT "no";
ALTER TABLE journals ADD last_update TIMESTAMP NOT NULL;
INSERT INTO vars (name, description, value) VALUES ("journal2submit_skid", "skid to submit journal entries to, if not set they go to mainpage skid", 0);
INSERT INTO vars (name, description, value) VALUES ("journal_allow_journal2submit", "Allow journals to be submitted as submissions?", 0);
INSERT INTO hooks (param, class, subroutine) VALUES ('journal_save_success', 'Slash::Journal', 'promoteJournal');
# 2005-11-28
UPDATE vars SET value = 'T_2_5_0_89' WHERE name = 'cvs_tag_currentcode';
ALTER TABLE topic_parents CHANGE COLUMN min_weight min_weight FLOAT DEFAULT 1 NOT NULL;
ALTER TABLE story_topics_chosen CHANGE COLUMN weight weight FLOAT DEFAULT 1 NOT NULL;
INSERT INTO vars (name, value, description) VALUES ('topiclist_ignore_prefix', '', 'prefix of any topic keywords that should not show up on topic list or hierarchy, leave blank if you don\'t want any ignored');
INSERT INTO vars (name, value, description) VALUES ('search_ignore_skids', '', 'list of skids that you want to not include in search results. Delimit skids with |');
DROP TABLE IF EXISTS journal_transfer;
CREATE TABLE journal_transfer (
id MEDIUMINT UNSIGNED NOT NULL,
subid MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
stoid MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
PRIMARY key(id)
);
# 2005-12-06
UPDATE vars SET value = 'T_2_5_0_90' WHERE name = 'cvs_tag_currentcode';
# Shut down your slashd and webheads before beginning the next commands.
# You don't want any writes to these tables while this series of commands
# executes.
ALTER TABLE users_logtokens ADD COLUMN public ENUM("yes","no") NOT NULL DEFAULT "no" AFTER temp;
ALTER TABLE users_logtokens DROP INDEX uid_locationid_temp;
ALTER TABLE users_logtokens ADD UNIQUE uid_locationid_temp_public (uid, locationid, temp, public);
ALTER TABLE users_logtokens ADD KEY (public);
# fix admin accounts
UPDATE users_logtokens, users SET public='yes' WHERE users_logtokens.uid=users.uid AND seclev > 1;
# Now you can turn your slashd and webheads back on.
# 2005-12-11
UPDATE vars SET value = 'T_2_5_0_91' WHERE name = 'cvs_tag_currentcode';
# 2005-12-19
UPDATE vars SET value = 'T_2_5_0_92' WHERE name = 'cvs_tag_currentcode';
# Changes for plugins/Daypass
INSERT INTO vars (name, value, description) VALUES ('daypass_offer_onlytologgedin', '0', 'If 1, offer a daypass only tologged-in users');
DROP TABLE IF EXISTS discussion_kinds;
CREATE TABLE discussion_kinds (
dkid TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(30) NOT NULL DEFAULT '',
PRIMARY KEY (dkid),
UNIQUE name (name)
) TYPE=InnoDB;
INSERT INTO discussion_kinds (dkid, name) VALUES (1, 'story');
INSERT INTO discussion_kinds (dkid, name) VALUES (2, 'user_created');
# plugins/Journal (ignore if not using that plugin)
INSERT INTO discussion_kinds (dkid, name) VALUES (NULL, 'journal');
INSERT INTO discussion_kinds (dkid, name) VALUES (NULL, 'journal-story');
# plugins/PollBooth (ignore if not using that plugin)
INSERT INTO discussion_kinds (dkid, name) VALUES (NULL, 'poll');
# You may want to wrap these next lines in a transaction, and if
# an error occurs you may want to ROLLBACK until you figure it out.
# On Slashdot this will likely take under 10 minutes.
# START TRANSACTION;
ALTER TABLE discussions ADD COLUMN dkid TINYINT UNSIGNED NOT NULL DEFAULT 1 AFTER id;
UPDATE discussions SET last_update=last_update, dkid=2;
UPDATE discussions, skins SET last_update=last_update, dkid=1 WHERE sid != '' AND discussions.url REGEXP CONCAT('^(http:)?//', skins.hostname, '/article\\.pl\\?sid=(', sid, '|[0-9]+$)');
UPDATE discussions, discussion_kinds, skins SET last_update=last_update, discussions.dkid=discussion_kinds.dkid WHERE discussion_kinds.name='journal' AND discussions.dkid=2 AND (discussions.url REGEXP CONCAT('^(http:)?//', skins.hostname, '/~[^/]+/journal/[0-9]+$') OR discussions.url REGEXP CONCAT('^(http:)?//', skins.hostname, '/journal\\.pl\\?op=display&id=[0-9]+&uid=', discussions.uid));
UPDATE discussions, discussion_kinds, skins SET last_update=last_update, discussions.dkid=discussion_kinds.dkid WHERE discussion_kinds.name='poll' AND discussions.dkid=2 AND discussions.url REGEXP CONCAT('^(http:)?//', skins.hostname, '/pollBooth\\.pl\\?(qid=[0-9]+&aid=-1|op=vote&qid=[0-9]+)$');
# COMMIT;
ALTER TABLE sessions DROP COLUMN logintime;
UPDATE users_info SET bio='' WHERE bio IS NULL;
ALTER TABLE users_info CHANGE COLUMN bio bio text NOT NULL;
# 2006-01-03
UPDATE vars SET value = 'T_2_5_0_93' WHERE name = 'cvs_tag_currentcode';
ALTER TABLE remarks MODIFY COLUMN remark VARCHAR(255);
# Changes for plugins/Submit (which you are almost certainly using)
INSERT INTO vars (name, value, description) VALUES ('submissions_link_relnofollow', '0', 'Add a rel="nofollow" to the submitter\'s vanity link for all submissions?');
UPDATE vars SET value=REPLACE(value, 'a:href_U,name,title ', 'a:href_U,name,title,rel ') WHERE name='approvedtags_attr_admin';
# 2006-01-11
UPDATE vars SET value = 'T_2_5_0_94' WHERE name = 'cvs_tag_currentcode';
DELETE FROM sessions;
ALTER TABLE sessions DROP INDEX uid;
ALTER TABLE sessions ADD UNIQUE uid (uid);
# Fairly major update to index selection - sectional stories are now by default shown in a brief / abbreviated mode
# on the mainpage. This default can be overriden by switching the "brief_sectional_mainpage" var to 0. A user
# will still be able to switch on brief mode in their options. If you want to avoid this remove the options
# by editting the tildeEd template.
#
# A skins artcount_max now affects the number of stories selected, you should make sure this number is larger than the
# number of stories you would post on your highest posting days (assuming you want to ensure the index shows all of "today's" stories
#
# -- vroom
ALTER TABLE users_index ADD COLUMN story_full_brief_nexus VARCHAR(255) NOT NULL DEFAULT '', ADD COLUMN story_brief_always_nexus VARCHAR(255) NOT NULL DEFAULT '', ADD COLUMN story_full_best_nexus VARCHAR(255) NOT NULL DEFAULT '', ADD COLUMN story_brief_best_nexus VARCHAR(255) NOT NULL DEFAULT "" AFTER story_always_nexus;
INSERT INTO vars (name, value, description) VALUES ("brief_sectional_mainpage", "1", "Show sectional stories in brief form on mainpage? 1 = yes, 0 = don't show");
ALTER TABLE skins ADD COLUMN skinindex ENUM('no', 'yes') DEFAULT 'yes' NOT NULL AFTER storypickable;
# Leaving this set to 0 will allow the current behavior of showing whatever leftover stories are left from the select for the main column of the index
# Changing this value to something positive will limit the number showing up in the Older Stories Slashbox
ALTER TABLE skins ADD COLUMN older_stories_max MEDIUMINT UNSIGNED DEFAULT '0' NOT NULL;
# 2006-01-18
UPDATE vars SET value = 'T_2_5_0_95' WHERE name = 'cvs_tag_currentcode';
# 2006-01-22
UPDATE vars SET value = 'T_2_5_0_96' WHERE name = 'cvs_tag_currentcode';
DROP TABLE IF EXISTS signoff;
CREATE TABLE signoff (
soid MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
stoid MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
uid MEDIUMINT UNSIGNED NOT NULL,
signoff_time TIMESTAMP,
PRIMARY KEY(soid),
INDEX (stoid)
) TYPE=InnoDB;
INSERT INTO vars (name, value, description) VALUES ("gse_mp_max_days_back", "0", "Max days back to go in gSE select for mainpage in instances where we haven't passed an offset / issue -- 0 if you don't want to use this");
INSERT INTO vars (name, value, description) VALUES ("gse_fallback_min_stoid", "0", "Set by set_gse_min_stoid to define how far back to search max when not passing an issue or offset");
ALTER TABLE skins ADD COLUMN require_acl VARCHAR(32) DEFAULT '' NOT NULL;
CREATE TABLE globjs (
globjid int UNSIGNED NOT NULL auto_increment,
gtid smallint UNSIGNED NOT NULL,
target_id int UNSIGNED NOT NULL,
PRIMARY KEY (globjid),
UNIQUE target (gtid, target_id)
) TYPE=InnoDB;
CREATE TABLE globj_types (
gtid smallint UNSIGNED NOT NULL auto_increment,
maintable VARCHAR(64) NOT NULL,
PRIMARY KEY (gtid),
UNIQUE maintable (maintable)
) TYPE=InnoDB;
INSERT INTO globj_types VALUES (NULL, 'stories');
# 2006-01-25
UPDATE vars SET value = 'T_2_5_0_97' WHERE name = 'cvs_tag_currentcode';
ALTER TABLE signoff ADD COLUMN signoff_type VARCHAR(16) DEFAULT '' NOT NULL;
INSERT INTO vars (name, value, description) VALUES ("signoff_notify", "0", "Add remark for bot on each signoff / update / save ?");
INSERT INTO vars (name, value, description) VALUES ("signoff_use", "0", "Use signoff functionalilty?");
DROP TABLE IF EXISTS related_stories;
CREATE TABLE related_stories (
id mediumint(8) unsigned NOT NULL auto_increment,
stoid mediumint(8) unsigned default '0',
rel_stoid mediumint(8) unsigned default '0',
rel_sid varchar(16) NOT NULL default '',
title varchar(255) default '',
url varchar(255) default '',
cid mediumint(8) unsigned NOT NULl default '0',
ordernum smallint unsigned NOT NULLdefault '0',
PRIMARY KEY (id),
KEY stoid (stoid)
) TYPE=InnoDB;
# 2006-02-01
UPDATE vars SET value = 'T_2_5_0_98' WHERE name = 'cvs_tag_currentcode';
ALTER TABLE reskey_resources CHANGE COLUMN rkrid rkrid SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE reskey_resource_checks CHANGE COLUMN rkrid rkrid SMALLINT UNSIGNED NOT NULL;
ALTER TABLE reskey_vars CHANGE COLUMN rkrid rkrid SMALLINT UNSIGNED NOT NULL;
ALTER TABLE reskeys CHANGE COLUMN rkrid rkrid SMALLINT UNSIGNED NOT NULL;
ALTER TABLE remarks ADD COLUMN priority SMALLINT UNSIGNED NOT NULL DEFAULT 0 AFTER stoid;
ALTER TABLE remarks ADD INDEX priority (priority);
# only do if you already installed Ajax plugin recently ... if you had it installed
# from awhile ago, important: go back and install the schema, then the dump, files
# for the plugin
UPDATE ajax_ops SET reskey_type = 'createuse' WHERE op = 'remarks_fetch';
# 2006-02-08
UPDATE vars SET value = 'T_2_5_0_99' WHERE name = 'cvs_tag_currentcode';
ALTER TABLE journal_transfer ADD COLUMN updated TINYINT UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE journal_transfer ADD KEY stoid_updated (stoid, updated);
# Changes for plugins/Ajax
INSERT INTO ajax_ops VALUES(NULL, 'admin_signoff', 'Slash::Admin', 'ajax_signoff', 'ajax_admin', 'createuse');
INSERT INTO vars (name, value, description) VALUES ('memcached_exptime_story','600','Number of seconds a story record lives in memcached before requiring a re-read from the DB');
UPDATE vars SET value='60' WHERE name='story_expire';
# 2006-02-15
UPDATE vars SET value = 'T_2_5_0_100' WHERE name = 'cvs_tag_currentcode';
INSERT INTO vars (name, value, description) VALUES ('referrer_external_static_redirect','1','If true, redirect anon requests referred from other sites for dynamic article.pl to static .shtml. This can greatly improve chances of surviving aslashdotting');
# Changes for plugins/Ajax
INSERT INTO ajax_ops VALUES(NULL, 'admin_slashdbox', 'Slash::Admin', 'ajax_slashdbox', 'ajax_admin', 'createuse');
INSERT INTO ajax_ops VALUES(NULL, 'admin_storyadminbox', 'Slash::Admin', 'ajax_storyadminbox', 'ajax_admin', 'createuse');
INSERT INTO ajax_ops VALUES(NULL, 'admin_authorbox', 'Slash::Admin', 'ajax_authorbox', 'ajax_admin', 'createuse');
INSERT INTO ajax_ops VALUES(NULL, 'admin_perfbox', 'Slash::Admin', 'ajax_perfbox', 'ajax_admin', 'createuse');
# 2006-02-22
UPDATE vars SET value = 'T_2_5_0_101' WHERE name = 'cvs_tag_currentcode';
# Changes for plugins/Tags
UPDATE templates SET page='misc' WHERE name='tagsstorydivtagbox' AND page='index' AND skin='default';
UPDATE users_info, users_hits SET lastaccess = lastclick WHERE users_info.uid=users_hits.uid AND lastaccess < lastclick;
# 2006-02-28
UPDATE vars SET value = 'T_2_5_0_102' WHERE name = 'cvs_tag_currentcode';
# Changes for plugins/Submit (which you are almost certainly using)
DROP TABLE IF EXISTS submissions_notes;
CREATE TABLE submissions_notes (
noid mediumint(8) unsigned NOT NULL auto_increment,
uid mediumint(8) unsigned NOT NULL default '0',
submatch varchar(32) NOT NULL default '',
subnote text,
time datetime default NULL,
PRIMARY KEY (noid)
) TYPE=InnoDB;
# Changes for plugins/Remarks
INSERT INTO ajax_ops VALUES (NULL, 'remarks_config', 'Slash::Remarks', 'ajaxFetchConfigPanel', 'ajax_admin', 'createuse');
INSERT INTO ajax_ops VALUES (NULL, 'remarks_config_save', 'Slash::Remarks', 'ajaxConfigSave', 'ajax_admin', 'createuse');
# Changes for plugins/Tags
INSERT INTO ajax_ops VALUES (NULL, 'tags_story_history', 'Slash::Tags', 'ajaxTagHistoryStory', 'ajax_admin', 'createuse');
ALTER TABLE tags DROP INDEX uid_globjid_tagnameid;
ALTER TABLE tags ADD COLUMN inactivated DATETIME DEFAULT NULL;
ALTER TABLE tags ADD INDEX uid_globjid_tagnameid_inactivated (uid, globjid, tagnameid, inactivated);
UPDATE vars SET value='^\!?[a-z][a-z0-9/]{0,62}$' WHERE name='tags_tagname_regex';
DROP TABLE IF EXISTS tag_params;
CREATE TABLE tag_params (
tagid int UNSIGNED NOT NULL,
name VARCHAR(32) DEFAULT '' NOT NULL,
value VARCHAR(64) DEFAULT '' NOT NULL,
UNIQUE tag_name (tagid, name)
) TYPE=InnoDB;
DROP TABLE IF EXISTS tagcommand_adminlog;
CREATE TABLE tagcommand_adminlog (
id int UNSIGNED NOT NULL AUTO_INCREMENT,
cmdtype VARCHAR(6) NOT NULL,
tagnameid int UNSIGNED NOT NULL,
globjid int UNSIGNED DEFAULT NULL,
adminuid mediumint UNSIGNED NOT NULL,
created_at datetime NOT NULL,
PRIMARY KEY id (id),
KEY created_at (created_at),
KEY tagnameid_globjid (tagnameid, globjid)
) TYPE=InnoDB;
# 2006-03-14
UPDATE vars SET value = 'T_2_5_0_103' WHERE name = 'cvs_tag_currentcode';
DROP TABLE IF EXISTS urls;
CREATE TABLE urls (
url_id INT(10) UNSIGNED NOT NULL auto_increment,
url_digest VARCHAR(32) NOT NULL,
url TEXT NOT NULL,
is_success TINYINT(4),
createtime datetime,
last_attempt datetime,
last_success datetime,
believed_fresh_until datetime,
status_code SMALLINT(6),
reason_phrase VARCHAR(30),
content_type VARCHAR(60),
initialtitle VARCHAR(255),
validatedtitle VARCHAR(255),
PRIMARY KEY (url_id),
UNIQUE url_digest (url_digest)
) Type=InnoDB;
INSERT INTO globj_types VALUES (NULL, 'urls');
INSERT IGNORE INTO reskey_resources VALUES (8, 'bookmark');
# 2006-03-21
UPDATE vars SET value = 'T_2_5_0_104' WHERE name = 'cvs_tag_currentcode';
# 2006-03-24
UPDATE vars SET value = 'T_2_5_0_105' WHERE name = 'cvs_tag_currentcode';
# For plugins/Ajax
UPDATE ajax_ops set reskey_type="use" where op="admin_signoff";
# For bookmarks plugin
INSERT INTO vars (name, description, value) VALUES ('bookmark_popular_days', "Number of days back to look for popular bookmarks", 1);
INSERT INTO vars (name, description, value) VALUES ('bookmark_allowed_schemes', "Schemes to allow for bookmarks. Separate entries with |", "http|https");
# 2006-03-29
UPDATE vars SET value = 'T_2_5_0_106' WHERE name = 'cvs_tag_currentcode';
ALTER TABLE comments ADD COLUMN last_update TIMESTAMP NOT NULL AFTER date;
UPDATE comments SET last_update = date;
INSERT INTO reskey_resource_checks (rkrcid, rkrid, type, class, ordernum) VALUES (NULL, 8, 'use', 'Slash::ResKey::Checks::Post', 151);
INSERT INTO reskey_resource_checks (rkrcid, rkrid, type, class, ordernum) VALUES (NULL, 8, 'all', 'Slash::ResKey::Checks::Duration', 601);
INSERT INTO reskey_resource_checks (rkrcid, rkrid, type, class, ordernum) VALUES (NULL, 8, 'all', 'Slash::ResKey::Checks::User', 101);
# Changes for plugins/Tags
INSERT INTO menus VALUES (NULL, 'tagszg', 'Active', 'active', '[% gSkin.rootdir %]/tags', 1, 1, 1);
INSERT INTO menus VALUES (NULL, 'tagszg', 'Recent', 'recent', '[% gSkin.rootdir %]/tags/recent', 1, 1, 2);
INSERT INTO menus VALUES (NULL, 'tagszg', 'All', 'all', '[% gSkin.rootdir %]/tags/all', 1, 1, 3);
UPDATE vars SET name='tags_stories_examples_pre' WHERE name='tags_stories_examples';
INSERT INTO vars (name, value, description) VALUES ('tags_stories_examples', '', 'Example tags for stories');
# Changes for plugins/Ajax
INSERT INTO ajax_ops VALUES (NULL, 'admin_learnword', 'Slash::Admin', 'admin_learnword', 'ajax_admin', 'createuse');
# 2006-04-05
UPDATE vars SET value = 'T_2_5_0_107' WHERE name = 'cvs_tag_currentcode';
# Changes for plugins/Relocate which ONLY need be applied if you
# installed it pre-June 2004. Somehow these changes were omitted
# from this upgrades file at that time. If you installed it
# after that time, you already have these changes.
ALTER TABLE links_for_stories ADD COLUMN stoid MEDIUMINT UNSIGNED NOT NULL FIRST;
UPDATE links_for_stories, stories SET links_for_stories.stoid=stories.stoid WHERE links_for_stories.sid=stories.sid;
ALTER TABLE links_for_stories DROP PRIMARY KEY, DROP KEY sid, ADD PRIMARY KEY (id, stoid), ADD KEY stoid (stoid), DROP COLUMN sid;
# Updates for plugins/Tags
UPDATE ajax_ops SET subroutine="ajaxTagHistory" where subroutine = "ajaxTagHistoryStory";
UPDATE ajax_ops SET op="tags_history" WHERE op="tags_story_history";
INSERT INTO vars (name, value, description) VALUES ('tags_urls_examples_pre', 'plus minus binspam', 'Example tags for urls');
INSERT INTO vars (name, value, description) VALUES ('tags_urls_examples', '', 'Example tags for urls');
INSERT INTO vars (name, value, description) VALUES ('tags_urls_lastscanned', '0', 'The last tagid scanned to update url');
INSERT INTO vars (name, value, description) VALUES ('tags_urls_top_minscore', '2', 'Minimum score a tag must have to make it into the top tags for a url');
INSERT INTO ajax_ops VALUES (NULL, 'tags_get_user_urls', 'Slash::Tags', 'ajaxGetUserUrls', 'ajax_tags_write', 'createuse');
INSERT INTO ajax_ops VALUES (NULL, 'tags_create_for_url', 'Slash::Tags', 'ajaxCreateForUrl', 'ajax_tags_write', 'use');
INSERT INTO ajax_ops VALUES (NULL, 'tags_get_admin_url', 'Slash::Tags', 'ajaxGetAdminUrl', 'ajax_admin', 'createuse');
ALTER TABLE urls ADD COLUMN tags_top VARCHAR(255) DEFAULT '' NOT NULL AFTER validatedtitle;
# 2006-04-11
UPDATE vars SET value = 'T_2_5_0_108' WHERE name = 'cvs_tag_currentcode';
INSERT INTO globj_types VALUES (NULL, 'submissions');
INSERT INTO globj_types VALUES (NULL, 'journals');
DROP TABLE IF EXISTS globj_urls;
CREATE TABLE globj_urls (
id INT UNSIGNED NOT NULL auto_increment,
globjid INT UNSIGNED NOT NULL DEFAULT 0,
url_id INT UNSIGNED NOT NULL NOT NULL DEFAULT 0,
PRIMARY KEY (id),
UNIQUE globjid_url_id (globjid, url_id)
) TYPE=InnoDB;
ALTER TABLE urls TYPE=InnoDB, ADD COLUMN popularity float DEFAULT '0' NOT NULL;
# updates for plugins/Tags
INSERT INTO vars (name, value, description) VALUES ('tags_urls_pos_tags', 'plus', '| separated list of tags applied which positively affect url popularity');
INSERT INTO vars (name, value, description) VALUES ('tags_urls_neg_tags', 'minus|binspam', '| separated list of tags applied which negatively affect url popularity');
# updates for plugins/Bookmark
UPDATE reskey_vars set value='1' where name='user_seclev' AND rkrid=8;
DROP TABLE IF EXISTS bookmark_feeds;
CREATE TABLE bookmark_feeds (
id MEDIUMINT UNSIGNED NOT NULL auto_increment,
uid MEDIUMINT UNSIGNED NOT NULL,
feed VARCHAR(255),
tags VARCHAR(255),
PRIMARY KEY(id)
) TYPE=InnoDB;
# Update for plugins/Ajax
UPDATE ajax_ops SET subroutine="ajax_learnword" where subroutine = "admin_learnword";
# 2006-04-19
UPDATE vars SET value = 'T_2_5_0_109' WHERE name = 'cvs_tag_currentcode';
INSERT INTO vars (name, value, description) VALUES ('url_checker_user_agent', '', 'user Agent to use for url checking task, empty string results in lwp user agent being used');
# 2006-04-26
UPDATE vars SET value = 'T_2_5_0_110' WHERE name = 'cvs_tag_currentcode';
# Update for plugins/Tags
CREATE TABLE tagboxes (
tbid smallint UNSIGNED NOT NULL AUTO_INCREMENT,
name varchar(32) DEFAULT '' NOT NULL,
affected_type ENUM('user', 'globj') NOT NULL,
weight float UNSIGNED DEFAULT 1.0 NOT NULL,
last_tagid_logged int UNSIGNED NOT NULL,
last_run_completed datetime,
PRIMARY KEY tbid (tbid),
UNIQUE name (name)
) TYPE=InnoDB;
CREATE TABLE tagbox_feederlog (
tfid int UNSIGNED NOT NULL AUTO_INCREMENT,
created_at datetime NOT NULL,
tbid smallint UNSIGNED NOT NULL,
tagid int UNSIGNED NOT NULL,
affected_id int UNSIGNED NOT NULL,
importance FLOAT UNSIGNED DEFAULT 1.0 NOT NULL,
PRIMARY KEY tfid (tfid),
KEY tbid_tagid (tbid, tagid),
KEY tbid_affectedid (tbid, affected_id)
) TYPE=InnoDB;
INSERT INTO tagboxes VALUES (NULL, 'tag_count', 'user', '1.0', 0, NULL);
# 2006-05-02
UPDATE vars SET value = 'T_2_5_0_111' WHERE name = 'cvs_tag_currentcode';
UPDATE tagboxes SET name='TagCountUser' WHERE name='tag_count';
ALTER TABLE tagboxes ADD COLUMN last_tdid_logged int UNSIGNED NOT NULL, ADD COLUMN last_tuid_logged int UNSIGNED NOT NULL;
RENAME TABLE tagbox_feederlog TO tagboxlog_feeder;
CREATE TABLE tagbox_userkeyregexes (
name varchar(32) NOT NULL,
userkeyregex varchar(255) NOT NULL,
UNIQUE name_regex (name, userkeyregex)
) TYPE=InnoDB;
CREATE TABLE tagboxlog_deactivated (
tdid int UNSIGNED NOT NULL AUTO_INCREMENT,
tagid int UNSIGNED NOT NULL,
PRIMARY KEY tdid (tdid),
KEY tagid (tagid)
) TYPE=InnoDB;
CREATE TABLE tagboxlog_userchange (
tuid int UNSIGNED NOT NULL AUTO_INCREMENT,
created_at datetime NOT NULL,
uid mediumint UNSIGNED NOT NULL,
user_key varchar(32) NOT NULL,
value_old text,
value_new text,
PRIMARY KEY tuid (tuid),
KEY uid (uid)
) TYPE=InnoDB;
# 2006