Changes to JW's Trials db
Posted by mholmes on 21 Aug 2012 in Activity log
On instructions from JW, added a new table and two new fields to the db. Tested first in dev, then carried out the same changes in live. SQL:
CREATE TABLE IF NOT EXISTS `period` ( `pd_id` INT NOT NULL AUTO_INCREMENT , `pd_name` varchar(128) collate utf8_unicode_ci default NULL , PRIMARY KEY (`pd_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `period` (`pd_id`, `pd_name`) VALUES (1, '[Unassigned]'); INSERT INTO `period` (`pd_id`, `pd_name`) VALUES (2, 'AR'); INSERT INTO `period` (`pd_id`, `pd_name`) VALUES (3, 'FR'); ALTER TABLE `trial` ADD COLUMN `tr_period` INT(11) NULL AFTER `tr_cote`; ALTER TABLE `trial` ADD COLUMN `tr_photos` INT(11) NULL AFTER `tr_description`; ALTER TABLE `trial` ADD CONSTRAINT `trial_ibfk_3` FOREIGN KEY (`tr_period`) REFERENCES `period` (`pd_id`) ON DELETE SET NULL ON UPDATE CASCADE;
Corresponding changes made to local_classes.php. Also wrote a script to copy data from live to dev db, and fixed a minor bug in the dev_to_live_update.sh script.