ALTER TABLE `apw_EventAttendee` DROP `title`;

ALTER TABLE `apw_Event`
    ADD INDEX `title` (`title`),
    ADD INDEX `startDate` (`startDate`),
    ADD INDEX `show` (`show`);

ALTER TABLE  `apw_Event` DROP FOREIGN KEY  `fk_Event_Cimmitee` ,
ADD FOREIGN KEY (  `committeeId` ) REFERENCES `apw_Committee` ( `id` ) ON DELETE SET NULL ON UPDATE RESTRICT ;


INSERT INTO `apw_Settings` (`name`, `idCategory`, `fieldType`, `label`, `value`, `options`, `description`, `required`, `system`, `sorter`, `added`, `changed`) VALUES
('transactionStatusChangedUserEmailHeader', 7, 'header', '', 'Payment confirmation (User Notification)', '', '', 'y', 'n', '800', '2013-03-18 09:30', '2013-03-18 09:30'),
('transactionStatusChangedUserEmailSubject', 7, 'text', 'Subject', 'Payment confirmation', '', '', 'y', 'n', '810', '2013-03-18 09:30', '2013-03-18 09:30'),
('transactionStatusChangedUserEmailFrom', 7, 'text', 'From Email Address', 'APWA-MN <info@apwa-mn.com>', '', '', 'y', 'n', '820', '2013-03-18 09:30', '2013-03-18 09:30'),
('transactionStatusChangedUserEmailBody', 7, 'HtmlEditor', 'Message Body', '<p>Payment status for <strong>{eventName}</strong> event has been changed to <strong>&quot;{status}&quot;.</strong></p><p><strong>Event start date:</strong> {startDate}</p><p><strong>Event end date:</strong> {endDate}</p>','', 'Constants: {eventName}, {startDate}, {endDate}, {status}', 'y', 'n', '830', '2013-03-18 09:30', '2013-03-18 09:30');


INSERT INTO `apw_SettingsOptions` (`id`, `name`, `variable`, `value`, `type`, `sorter`) VALUES
(NULL, 'transactionStatusChangedUserEmailBody', 'toolbar', 'Basic', 'string', 800),
(NULL, 'transactionStatusChangedUserEmailBody', 'mode', 'view', 'string', 810);


-- 2013-03-19
UPDATE `apw_Settings` SET `value` = 'Event Registration Notification (to user)' WHERE `name` = 'eventSignupNotificationHeader' ;

INSERT INTO `apw_Settings` (`name`, `idCategory`, `fieldType`, `label`, `value`, `options`, `description`, `required`, `system`, `sorter`, `added`, `changed`) VALUES
('eventSignupNotificationFrom', 2, 'text', 'From Email Address', 'APWA-MN <info@apwa-mn.com>', '', '', 'y', 'n', 607, '2013-03-19 09:30', '2013-03-19 09:30');

UPDATE `apw_Settings` SET `description` = 'Constants: {title} {location} {link} {date} {time}' WHERE `name` = 'eventSignupNotificationBody' ;


INSERT INTO `apw_SettingsOptions` (`id`, `name`, `variable`, `value`, `type`, `sorter`) VALUES
(NULL, 'eventSignupNotificationBody', 'toolbar', 'Basic', 'string', 610),
(NULL, 'eventSignupNotificationBody', 'mode', 'view', 'string', 610);


INSERT INTO `apw_SettingsOptions` (`id`, `name`, `variable`, `value`, `type`, `sorter`) VALUES
(NULL, 'jobListingAdded2AdminBody', 'toolbar', 'Basic', 'string', 900),
(NULL, 'jobListingAdded2AdminBody', 'mode', 'view', 'string', 900);


-- 2013-03-20
-- SELECT * FROM apw_Settings WHERE `name` LIKE 'eventSignupNotificationGroup%'

INSERT INTO `apw_Settings` (`name`, `idCategory`, `fieldType`, `label`, `value`, `options`, `description`, `required`, `system`, `sorter`, `added`, `changed`) VALUES
('eventSignupNotificationGroupHeader', 2, 'header', '', 'Event Registration Notification (Group Events) (sends to user)', '', '', 'n', 'n', 620, '2013-01-31 14:00:00', '2013-01-31 14:00:00'),
('eventSignupNotificationGroupSubject', 2, 'text', 'Subject', 'You were registered for event', '', '', 'y', 'n', 622, '2013-01-31 14:00:00', '2013-03-07 11:59:04'),
('eventSignupNotificationGroupFrom', 2, 'text', 'From Email Address', 'APWA-MN <info@apwa-mn.com>', '', '', 'y', 'n', 624, '2013-03-19 09:30:00', '2013-03-19 09:30:00'),
('eventSignupNotificationGroupBody', 2, 'HtmlEditor', 'Message Body', '<p>You have been registered for the following APWA-MN event:&nbsp;<strong>{title}</strong>.</p>\n<p><strong>Date:</strong> {date}</p>\n<p><strong>Time:</strong> {time}</p>\n<p><strong>Location:</strong> {location}.</p>\n<p><strong>Team:</strong> {teamName}</p>\n<p><strong>Attendees:</strong></p>\n<p>{attendees}</p>\n<p><a href="{link}">View details</a></p>', '', 'Constants: {title} {location} {link} {date} {time} {teamName} {attendees}', 'y', 'n', 626, '2013-01-31 14:00:00', '2013-03-07 11:59:04');

INSERT INTO `apw_SettingsOptions` (`id`, `name`, `variable`, `value`, `type`, `sorter`) VALUES
(NULL, 'eventSignupNotificationGroupBody', 'toolbar', 'Basic', 'string', 900),
(NULL, 'eventSignupNotificationGroupBody', 'mode', 'view', 'string', 900);

UPDATE `apw_Settings`
SET `value` = 'Group Event Registration Notification (sends to user)'
WHERE `name` = 'eventSignupNotificationGroupHeader';