upgrade.sql
changeset 229 97ae8e9d5e29
parent 228 b0a4d179be85
child 266 917dcc6c4ceb
equal deleted inserted replaced
147:d8156d18ac58 229:97ae8e9d5e29
     1 -- Enano CMS - upgrade SQL
     1 -- Enano CMS - upgrade SQL
     2 -- Variables are in the format {{VAR_NAME}}
     2 -- Variables are in the format {{VAR_NAME}}
     3 -- ALL NON-SQL LINES, even otherwise blank lines, must start with "--" or they will get sent to MySQL!
     3 -- ALL NON-SQL LINES, even otherwise blank lines, must start with "--" or they will get sent to MySQL!
     4 -- Common tasks (version numbers)
     4 -- Common tasks (version numbers)
     5 DELETE FROM {{TABLE_PREFIX}}config WHERE config_name='enano_version' OR config_name='enano_beta_version' OR config_name='enano_alpha_version' OR config_name='enano_rc_version';
     5 DELETE FROM {{TABLE_PREFIX}}config WHERE config_name='enano_version' OR config_name='enano_beta_version' OR config_name='enano_alpha_version' OR config_name='enano_rc_version';
     6 INSERT INTO {{TABLE_PREFIX}}config (config_name, config_value) VALUES( 'enano_version', '1.0.2' ),( 'enano_beta_version', '1' );
     6 INSERT INTO {{TABLE_PREFIX}}config (config_name, config_value) VALUES( 'enano_version', '1.1.1' );
       
     7 ---BEGIN Stable1.0ToUnstable1.1---
       
     8 -- UPDATE {{TABLE_PREFIX}}groups SET group_id=9998 WHERE group_id=4;
       
     9 -- UPDATE {{TABLE_PREFIX}}group_members SET group_id=9998 WHERE group_id=4;
       
    10 -- INSERT INTO {{TABLE_PREFIX}}groups(group_id,group_name,group_type,system_group) VALUES(4, 'Regular members', 3, 1);
       
    11 CREATE TABLE {{TABLE_PREFIX}}lockout( id int(12) NOT NULL auto_increment, ipaddr varchar(40) NOT NULL, action ENUM('credential', 'level') NOT NULL DEFAULT 'credential', timestamp int(12) NOT NULL DEFAULT 0, PRIMARY KEY ( id ) ) CHARACTER SET `utf8`;
       
    12 CREATE TABLE {{TABLE_PREFIX}}language( lang_id smallint(5) NOT NULL auto_increment, lang_code varchar(16) NOT NULL, lang_name_default varchar(64) NOT NULL, lang_name_native varchar(64) NOT NULL, last_changed int(12) NOT NULL DEFAULT 0, PRIMARY KEY ( lang_id ) ) CHARACTER SET `utf8`;
       
    13 CREATE TABLE {{TABLE_PREFIX}}language_strings( string_id bigint(15) NOT NULL auto_increment, lang_id smallint(5) NOT NULL, string_category varchar(32) NOT NULL, string_name varchar(64) NOT NULL, string_content longtext NOT NULL, PRIMARY KEY ( string_id ) );
       
    14 ALTER TABLE {{TABLE_PREFIX}}users ADD COLUMN user_lang smallint(5) NOT NULL;
       
    15 ---END Stable1.0ToUnstable1.1---
       
    16 ---BEGIN 1.0.2---
       
    17 ---END 1.0.2---
       
    18 ---BEGIN 1.0.2b1---
       
    19 -- This is really optional, but could reduce confusion if regex page groups get truncated for no apparent reason.
       
    20 ALTER TABLE {{TABLE_PREFIX}}page_groups MODIFY COLUMN pg_target text DEFAULT NULL;
       
    21 ---END 1.0.2b1---
     7 ---BEGIN 1.0.1.1---
    22 ---BEGIN 1.0.1.1---
     8 -- No changes in this release
       
     9 ---END 1.0.1.1---
    23 ---END 1.0.1.1---
    10 ---BEGIN 1.0.1---
    24 ---BEGIN 1.0.1---
    11 -- No changes in this release
       
    12 ---END 1.0.1---
    25 ---END 1.0.1---
    13 ---BEGIN 1.0---
    26 ---BEGIN 1.0---
    14 -- Fix for obnoxious $_GET issue
    27 -- Fix for obnoxious $_GET issue
    15 UPDATE {{TABLE_PREFIX}}sidebar SET block_type=1,block_content='<div class="slideblock2" style="padding: 0px;"><form action="$CONTENTPATH$$NS_SPECIAL$Search" method="get" style="padding: 0; margin: 0;"><p><input type="hidden" name="title" value="$NS_SPECIAL$Search" />$INPUT_AUTH$<input name="q" alt="Search box" type="text" size="10" style="width: 70%" /> <input type="submit" value="Go" style="width: 20%" /></p></form></div>' WHERE block_name='Search' AND item_id=4;
    28 UPDATE {{TABLE_PREFIX}}sidebar SET block_type=1,block_content='<div class="slideblock2" style="padding: 0px;"><form action="$CONTENTPATH$$NS_SPECIAL$Search" method="get" style="padding: 0; margin: 0;"><p><input type="hidden" name="title" value="$NS_SPECIAL$Search" />$INPUT_AUTH$<input name="q" alt="Search box" type="text" size="10" style="width: 70%" /> <input type="submit" value="Go" style="width: 20%" /></p></form></div>' WHERE block_name='Search' AND item_id=4;
    16 -- Added on advice from Neal
    29 -- Added on advice from Neal
    82 UPDATE {{TABLE_PREFIX}}themes SET theme_order=2 WHERE theme_id='oxygen';
    95 UPDATE {{TABLE_PREFIX}}themes SET theme_order=2 WHERE theme_id='oxygen';
    83 UPDATE {{TABLE_PREFIX}}users SET theme='stpatty',style='shamrock';
    96 UPDATE {{TABLE_PREFIX}}users SET theme='stpatty',style='shamrock';
    84 ---END 1.0b4---
    97 ---END 1.0b4---
    85 ---BEGIN 1.0b3---
    98 ---BEGIN 1.0b3---
    86 INSERT INTO {{TABLE_PREFIX}}config(config_name, config_value) VALUES( 'allowed_mime_types', 'cbf:len=168;crc=c3dcad3f;data=0[1],1[4],0[3],1[1],0[2],1[1],0[11],1[1],0[7],1[1],0[9],1[1],0[6],1[3],0[10],1[1],0[2],1[2],0[1],1[1],0[1],1[2],0[6],1[3],0[1],1[1],0[2],1[4],0[1],1[2],0[3],1[1],0[4],1[2],0[26],1[5],0[6],1[2],0[2],1[1],0[4],1[1],0[10],1[2],0[1],1[1],0[6]|end' );
    99 INSERT INTO {{TABLE_PREFIX}}config(config_name, config_value) VALUES( 'allowed_mime_types', 'cbf:len=168;crc=c3dcad3f;data=0[1],1[4],0[3],1[1],0[2],1[1],0[11],1[1],0[7],1[1],0[9],1[1],0[6],1[3],0[10],1[1],0[2],1[2],0[1],1[1],0[1],1[2],0[6],1[3],0[1],1[1],0[2],1[4],0[1],1[2],0[3],1[1],0[4],1[2],0[26],1[5],0[6],1[2],0[2],1[1],0[4],1[1],0[10],1[2],0[1],1[1],0[6]|end' );
       
   100 ALTER TABLE {{TABLE_PREFIX}}privmsgs ADD COLUMN message_read tinyint(1) NOT NULL DEFAULT 0;
    87 ---END 1.0b3---
   101 ---END 1.0b3---
    88 ---BEGIN 1.0b2---
   102 ---BEGIN 1.0b2---
    89 -- 10/1: Removed alterations to users table, moved to upgrade.php, to allow the session manager to work
   103 -- 10/1: Removed alterations to users table, moved to upgrade.php, to allow the session manager to work
    90 CREATE TABLE {{TABLE_PREFIX}}privmsgs( message_id int(15) NOT NULL auto_increment, message_from varchar(63), message_to varchar(255), date int(12), subject varchar(63), message_text text, folder_name varchar(63), PRIMARY KEY (message_id) );
   104 CREATE TABLE {{TABLE_PREFIX}}privmsgs( message_id int(15) NOT NULL auto_increment, message_from varchar(63), message_to varchar(255), date int(12), subject varchar(63), message_text text, folder_name varchar(63), PRIMARY KEY (message_id) );
    91 CREATE TABLE {{TABLE_PREFIX}}buddies( buddy_id int(15) NOT NULL auto_increment, user_id mediumint(8), buddy_user_id mediumint(8), is_friend tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (buddy_id) );
   105 CREATE TABLE {{TABLE_PREFIX}}buddies( buddy_id int(15) NOT NULL auto_increment, user_id mediumint(8), buddy_user_id mediumint(8), is_friend tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (buddy_id) );