-- 2014-04-01 gakunen updates

SELECT id, last_name, date_modified, grade, grade_entrance_date, grade_entered, date_modified, date_entered, contact_status FROM contacts WHERE smsgroup='student' AND grade  IN ("00", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17") 
	AND  date_modified <='2014-04-01 00:00:00'

UPDATE contacts SET grade="general" WHERE smsgroup='student' AND grade ="17" 
	AND  date_modified <='2014-04-01 00:00:00'
UPDATE contacts SET grade=grade+1 WHERE smsgroup='student' AND grade  IN ("00", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16") 
	AND  date_modified <='2014-04-01 00:00:00'

-- 2016-09-27 Bug 61157
ALTER TABLE sms_fee ADD COLUMN name_kana VARCHAR(30) AFTER NAME;

-- 2016-10-19 (mon) smartpit ref: 61270
ALTER TABLE contacts ADD COLUMN smartpit_id VARCHAR(13)

-- 2016-10-20 (mon) smartpit ref; 61270
-- CREATE a COPY the actual combiniactions_history to smartpitactions_history, and combini_history to smartpit_history
-- Then run the following code:
ALTER TABLE smartpit_history ADD COLUMN name_kana VARCHAR(36);
ALTER TABLE smartpit_history ADD COLUMN billing_id VARCHAR(10);

-- 2016-10-27 change combiniactions_id to smartpitactions_id
ALTER TABLE `smartpit_history` CHANGE `combiniactions_id` `smartpitactions_id` VARCHAR(36) CHARSET utf8 COLLATE utf8_general_ci NOT NULL; 

-- 73936 (rio)  resource.order_number
ALTER TABLE resource ADD COLUMN order_number VARCHAR(5);
