
-- 2012-10-10
ALTER TABLE `users` CHANGE `user_preferences` `user_preferences` MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ;

-- 2012-10-16
-- NOTE once tableli sec ve table ismini degistir
-- emailsemail_cstm => emails_sub1
RENAME TABLE `emailsemail_cstm` TO `emails_sub1` ;
ALTER TABLE `emails_sub1` CHANGE `id_c` `id_sub1` VARCHAR( 36 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;

-- NOTE once tableli sec ve table ismini degistir
-- resourceschool_cstm => resource_sub1
RENAME TABLE `resourceschool_cstm` TO `resource_sub1` ;
ALTER TABLE `resource_sub1` CHANGE `id_c` `id_sub1` VARCHAR( 36 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

-- 2012-11-06 exam table hizuke updatr
UPDATE `exam` SET `instance_id`=DATE_ADD(`instance_id`, INTERVAL 540 MINUTE) WHERE  instance_id LIKE '2%'

-- 2012-11-03
ALTER TABLE `resource` ADD `area_id` VARCHAR( 10 ) NULL DEFAULT NULL ;

ALTER TABLE `sms_salesgroup` CHANGE `salesno` `salesno` VARCHAR( 36 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ;
ALTER TABLE `sms_fee` CHANGE `salesno` `salesno` VARCHAR( 36 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ;

-- 2012-12-03
ALTER TABLE `sms_transaction` ADD `fee_name` VARCHAR( 100 ) NULL DEFAULT NULL ;
ALTER TABLE `sms_transaction` ADD `school_id` VARCHAR( 36 ) NULL DEFAULT NULL ;

-- 2012-12-18 
ALTER TABLE `sms_recurrence` ADD `actual_number_of_occurrences` INT( 4 ) NULL DEFAULT '0' AFTER `actual_event_end`;

-- 2012-12-20
UPDATE `bank_info`.`bank_info` SET `katakana` = 'ﾐﾂｲｽﾐﾄﾓｼﾝﾀｸ ',
`name` = '三井住友信託' WHERE CONVERT( `bank_info`.`bank_code` USING utf8 ) = '0294' AND CONVERT( `bank_info`.`branch_code` USING utf8 ) = '000' AND CONVERT( `bank_info`.`katakana` USING utf8 ) = 'ｽﾐﾄﾓｼﾝﾀｸ ' AND CONVERT( `bank_info`.`name` USING utf8 ) = '住友信託' AND CONVERT( `bank_info`.`type` USING utf8 ) = '1' AND CONVERT( `bank_info`.`branch_type` USING utf8 ) = '1' LIMIT 1 ;
INSERT INTO `bank_info`.`bank_info` (`bank_code`, `branch_code`, `katakana`, `name`, `type`, `branch_type`) VALUES ('0294', '629', 'ﾊﾁｵｳｼﾞ', '八王子', '2', '1');

-- 2012-12-26
ALTER TABLE `contacts` ADD `nyutai_mail_notice` TINYINT NOT NULL DEFAULT '0' AFTER `card_id` ;

--2012-12-26   nyutai resource insert

INSERT INTO `resource` (`id`, `school_id`, `date_entered`, `date_modified`, `modified_user_id`, `created_by`, `name`, `shortname`, `description`, `category`, `location`, `deleted`, `capacity`, `resource_attributes`, `common_code`, `activation_key`, `area_id`) VALUES
('nyutai_install_id_yo_1', '7b00e40c-8b57-406a-ac7f-4b343f2451d7', '2012-12-26 17:00:00', '2012-12-26 17:00:00', '1', '1', 'entrance system', '横浜校', '', 'entrance', NULL, 0, 1, '', NULL, '', NULL),
('nyutai_install_id_ue_1', 'db265adc-c5a8-f8d0-a7a6-4b343ee6e1bf', '2012-12-26 17:00:00', '2012-12-26 17:00:00', '1', '1', 'entrance system', '上野の森校舎', '', 'entrance', NULL, 0, 1, '', NULL, '', NULL),
('nyutai_install_id_to_1', '4a493c88-1df0-aad0-3c96-4b343f2f6c7a', '2012-12-26 17:00:00', '2012-12-26 17:00:00', '1', '1', 'entrance system', '所沢校', '', 'entrance', NULL, 0, 1, '', NULL, '', NULL),
('nyutai_install_id_ta_1', '157d198b-2416-0e1e-5dc3-4b343e7e1461', '2012-12-26 17:00:00', '2012-12-26 17:00:00', '1', '1', 'entrance system', '立川駅・北口校', '', 'entrance', NULL, 0, 1, '', NULL, '', NULL),
('nyutai_install_id_om_1', 'd358388c-1af7-9977-4268-4b343e3e65e3', '2012-12-26 17:00:00', '2012-12-26 17:00:00', '1', '1', 'entrance system', '大宮校', '', 'entrance', NULL, 0, 1, '', NULL, '', NULL),
('nyutai_install_id_ni_1', '863649b2-6596-dd64-39ee-4b3452b0aeb5', '2012-12-26 17:00:00', '2012-12-26 17:00:00', '1', '1', 'entrance system', '西荻本校', '', 'entrance', NULL, 0, 1, '', NULL, '', NULL),
('nyutai_install_id_mi_1', 'e68e95eb-26e6-af79-5ec9-4b343ec9f4ce', '2012-12-26 17:00:00', '2012-12-26 17:00:00', '1', '1', 'entrance system', '南浦和校', '', 'entrance', NULL, 0, 1, '', NULL, '', NULL),
('nyutai_install_id_ch_1', '1e815a81-badd-ce69-5e94-4b343f88a265', '2012-12-26 17:00:00', '2012-12-26 17:00:00', '1', '1', 'entrance system', '千葉駅校', '', 'entrance', NULL, 0, 1, '', NULL, '', NULL);


-- NOTE:  ACL_install_actions !!!