ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 6813


Ignore:
Timestamp:
Apr 29, 2008, 12:18:25 AM (11 years ago)
Author:
ogawa
Message:

#2303:mysql40のupgradeSQLを修正

Location:
OpenPNE/trunk/setup/sql
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/setup/sql/mysql40/upgrade/upgrade-2.10to2.12.sql

    r6812 r6813  
    150150INSERT IGNORE INTO `c_admin_config` VALUES (NULL,'OPENPNE_USE_DECORATION',1);
    151151
    152 -- update09
     152-- update09, update16, update17
    153153CREATE TABLE `c_member_config` (
    154154  `c_member_config_id` int(11) NOT NULL auto_increment,
    155155  `c_member_id` int(11) NOT NULL default '0',
    156   `c_member_config_option_id` int(11) NOT NULL default '0',
    157156  `value` text NOT NULL,
     157  `name` varchar(64) NOT NULL default '',
    158158  PRIMARY KEY  (`c_member_config_id`),
    159   KEY `c_member_id` (`c_member_id`),
    160   KEY `c_member_config_option_id` (`c_member_config_option_id`),
    161   KEY `c_member_config_option_id_c_member_id` (`c_member_config_option_id`,`c_member_id`)
    162 ) ENGINE=MyISAM;
    163 
    164 CREATE TABLE `c_member_config_option` (
    165   `c_member_config_option_id` int(11) NOT NULL auto_increment,
    166   `name` varchar(64) NOT NULL default '',
    167   PRIMARY KEY  (`c_member_config_option_id`),
    168   UNIQUE KEY `name` (`name`)
    169 ) ENGINE=MyISAM;
    170 
    171 INSERT INTO `c_member_config_option` VALUES (NULL,'SEND_DIARY_COMMENT_MAIL_KTAI');
     159  KEY `c_member_id` (`c_member_id`)
     160) ENGINE=MyISAM;
    172161
    173162-- update10
     
    203192ALTER IGNORE TABLE c_member_pre ADD COLUMN public_flag_birth_month_day enum('public','friend','private') NOT NULL default 'public' AFTER public_flag_birth_year;
    204193
    205 -- update13
     194-- update13, update14
    206195ALTER TABLE c_commu_topic ADD COLUMN u_datetime datetime NOT NULL default '0000-00-00 00:00:00';
    207196
     
    210199
    211200CREATE INDEX c_commu_id_c_member_id ON c_commu_member(c_commu_id,c_member_id);
    212 
    213 CREATE TABLE `c_diary_comment_log` (
    214   `c_diary_comment_log_id` int(11) NOT NULL auto_increment,
    215   `c_member_id` int(11) NOT NULL default '0',
    216   `c_diary_id`  int(11) NOT NULL default '0',
    217   `r_datetime`  datetime NOT NULL default '0000-00-00 00:00:00',
    218   PRIMARY KEY (`c_diary_comment_log_id`)
    219 ) ENGINE=MyISAM;
    220 
    221 CREATE INDEX `c_member_id_r_datetime` ON `c_diary_comment_log`(c_member_id,r_datetime);
    222 CREATE INDEX `c_diary_id` ON `c_diary_comment_log`(c_diary_id);
    223 CREATE INDEX `c_diary_id_r_datetime` ON `c_diary_comment_log`(c_diary_id,r_datetime);
    224 CREATE INDEX `c_member_id_c_diary_id` ON `c_diary_comment_log`(c_member_id,c_diary_id);
    225201
    226202DROP TABLE IF EXISTS `tmp_c_commu_topic`;
     
    242218DROP TABLE tmp_c_commu_topic;
    243219
    244 INSERT INTO c_diary_comment_log (c_diary_comment_log_id, c_member_id, c_diary_id, r_datetime)
    245   (SELECT NULL, c_member_id, c_diary_id, MAX(r_datetime) AS r_datetime
    246     FROM c_diary_comment
    247     WHERE TO_DAYS(NOW()) - TO_DAYS(r_datetime) <= 15
    248     GROUP BY c_member_id, c_diary_id
    249     ORDER BY r_datetime);
    250 
    251 -- update14
    252 TRUNCATE TABLE `c_diary_comment_log`;
    253 
     220CREATE TABLE `c_diary_comment_log` (
     221  `c_diary_comment_log_id` int(11) NOT NULL auto_increment,
     222  `c_member_id` int(11) NOT NULL default '0',
     223  `c_diary_id` int(11) NOT NULL default '0',
     224  `r_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
     225  PRIMARY KEY  (`c_diary_comment_log_id`),
     226  KEY `c_member_id_r_datetime` (`c_member_id`,`r_datetime`),
     227  KEY `c_diary_id` (`c_diary_id`),
     228  KEY `c_diary_id_r_datetime` (`c_diary_id`,`r_datetime`),
     229  KEY `c_member_id_c_diary_id` (`c_member_id`,`c_diary_id`)
     230) TYPE=MyISAM;
     231
     232DROP TABLE IF EXISTS tmp_c_diary_comment_log;
    254233CREATE TABLE `tmp_c_diary_comment_log` (
    255234  `c_diary_comment_log_id` int(11) NOT NULL auto_increment,
     
    295274ALTER TABLE `c_cmd` ADD COLUMN `r_datetime` datetime NOT NULL default '0000-00-00 00:00:00';
    296275ALTER TABLE `c_cmd` ADD COLUMN `u_datetime` datetime NOT NULL default '0000-00-00 00:00:00';
    297 
    298 -- update16
    299 ALTER TABLE `c_member_config` ADD COLUMN `name` varchar(64) NOT NULL default '';
    300 
    301 UPDATE c_member_config, c_member_config_option SET c_member_config.name = c_member_config_option.name
    302     WHERE c_member_config.c_member_config_option_id = c_member_config_option.c_member_config_option_id;
    303 
    304 DROP TABLE `c_member_config_option`;
    305 ALTER TABLE `c_member_config` DROP COLUMN `c_member_config_option_id`;
    306 
    307 -- update17
    308 DROP INDEX c_member_config_option_id_c_member_id ON c_member_config;
  • OpenPNE/trunk/setup/sql/mysql41/upgrade/upgrade-2.10to2.12.sql

    r6809 r6813  
    152152INSERT IGNORE INTO `c_admin_config` VALUES (NULL,'OPENPNE_USE_DECORATION',1);
    153153
    154 -- update09, update16
     154-- update09, update16, update17
    155155CREATE TABLE `c_member_config` (
    156156  `c_member_config_id` int(11) NOT NULL auto_increment,
Note: See TracChangeset for help on using the changeset viewer.