install/schemas/upgrade/1.1.5-1.1.6-mysql.sql
author Dan
Thu, 17 Dec 2009 04:27:50 -0500
changeset 1168 277a9cdead3e
parent 927 e964577b5fa9
permissions -rw-r--r--
Namespace_Default: added a workaround for an inconsistency in SQL. Basically, if you join the same table multiple times under multiple aliases, COUNT() always uses the first instance. Was affecting the comment counter in the "discussion" button.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
831
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
     1
ALTER TABLE {{TABLE_PREFIX}}users ADD COLUMN password_salt varchar(40) NOT NULL DEFAULT '';
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
     2
ALTER TABLE {{TABLE_PREFIX}}pages ADD COLUMN page_format varchar(16) NOT NULL DEFAULT 'wikitext';
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
     3
ALTER TABLE {{TABLE_PREFIX}}logs ADD COLUMN page_format varchar(16) NOT NULL DEFAULT 'wikitext';
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
     4
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
     5
-- Make page_id and namespace column sizes consistent (former bug)
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
     6
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
     7
ALTER TABLE {{TABLE_PREFIX}}comments MODIFY COLUMN page_id varchar(512) NOT NULL,
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
     8
  MODIFY COLUMN namespace varchar(16) NOT NULL;
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
     9
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    10
ALTER TABLE {{TABLE_PREFIX}}logs MODIFY COLUMN page_id varchar(512) NOT NULL,
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    11
  MODIFY COLUMN namespace varchar(16) NOT NULL;
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    12
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    13
ALTER TABLE {{TABLE_PREFIX}}page_text MODIFY COLUMN page_id varchar(512) NOT NULL;
801
eb8b23f11744 Two big commits in one day I know, but redid password storage to use HMAC-SHA1. Consolidated much AES processing to three core methods in session that should handle everything automagically. Installation works; upgrades should. Rebranded as 1.1.6.
Dan
parents:
diff changeset
    14
831
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    15
ALTER TABLE {{TABLE_PREFIX}}pages MODIFY COLUMN urlname varchar(512) NOT NULL;
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    16
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    17
ALTER TABLE {{TABLE_PREFIX}}hits MODIFY COLUMN page_id varchar(512) NOT NULL,
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    18
  MODIFY COLUMN namespace varchar(16) NOT NULL;
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    19
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    20
ALTER TABLE {{TABLE_PREFIX}}acl MODIFY COLUMN page_id varchar(512),
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    21
  MODIFY COLUMN namespace varchar(16);
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    22
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    23
ALTER TABLE {{TABLE_PREFIX}}page_group_members MODIFY COLUMN page_id varchar(512) NOT NULL,
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    24
  MODIFY COLUMN namespace varchar(16) NOT NULL;
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    25
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    26
ALTER TABLE {{TABLE_PREFIX}}tags MODIFY COLUMN page_id varchar(512) NOT NULL,
45e887f23282 Made all page_id and namespace columns consistent
Dan
parents: 801
diff changeset
    27
  MODIFY COLUMN namespace varchar(16) NOT NULL;
927
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    28
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    29
-- Added in 1.1.6: Indices for several tables
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    30
-- The size of 317 is a trial-and-error-produced value based on MySQL's index column size limit
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    31
-- of 1000 bytes. It's low like that because of the UTF-8 character set being used.
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    32
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    33
@ALTER TABLE {{TABLE_PREFIX}}logs ADD INDEX {{TABLE_PREFIX}}logs_page_idx (page_id(317), namespace);
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    34
@ALTER TABLE {{TABLE_PREFIX}}logs ADD INDEX {{TABLE_PREFIX}}logs_time_idx (time_id);
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    35
@ALTER TABLE {{TABLE_PREFIX}}logs ADD INDEX {{TABLE_PREFIX}}logs_action_idx (log_type, action);
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    36
@ALTER TABLE {{TABLE_PREFIX}}comments ADD INDEX {{TABLE_PREFIX}}comments_page_idx (page_id(317), namespace);
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    37
@ALTER TABLE {{TABLE_PREFIX}}hits ADD INDEX {{TABLE_PREFIX}}hits_time_idx ( time );
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    38
@ALTER TABLE {{TABLE_PREFIX}}hits ADD INDEX {{TABLE_PREFIX}}hits_page_idx (page_id(317), namespace);
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    39
@ALTER TABLE {{TABLE_PREFIX}}pages ADD INDEX {{TABLE_PREFIX}}pages_page_idx (urlname(317), namespace);
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    40
@ALTER TABLE {{TABLE_PREFIX}}page_text ADD INDEX {{TABLE_PREFIX}}page_text_page_idx (page_id(317), namespace);
e964577b5fa9 Added the indices to the 1.1.5 -> 1.1.6 upgrade schema
Dan
parents: 831
diff changeset
    41