CREATE TABLE IF NOT EXISTS `mm_StatutoryAuthority` (
  `id` int(10) unsigned NOT NULL,
  `title` varchar(32) NOT NULL,
  `sorter` int(11) NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

INSERT INTO `mm_StatutoryAuthority` (`id`, `title`, `sorter`) VALUES
(1, 'Statutory', 0),
(2, 'Home Rule Charter', 1);

ALTER TABLE `mm_StatutoryAuthority` ADD PRIMARY KEY (`id`), ADD KEY `sorter` (`sorter`);
ALTER TABLE `mm_StatutoryAuthority` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;

ALTER TABLE `mm_Company`
ADD `population` INT UNSIGNED NULL AFTER `countyId`,
ADD `statutoryAuthorityId` INT UNSIGNED NULL AFTER `population`,
ADD INDEX (`population`),
ADD INDEX (`statutoryAuthorityId`) ;

ALTER TABLE `mm_Company`
ADD FOREIGN KEY (`statutoryAuthorityId`) REFERENCES `mm_StatutoryAuthority`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;

ALTER TABLE  `mm_UserAddress` CHANGE  `type`  `type` ENUM(  'billing',  'shipping',  'mailing' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;