CREATE TABLE `sta_PartnerGroup` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `title` varchar(255) NOT NULL,
 `sorter` int(11) NOT NULL,
 `added` datetime NOT NULL,
 `changed` datetime NOT NULL,
 PRIMARY KEY (`id`),
 KEY `sorter` (`sorter`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE `sta_Partner` ADD `groupId` INT UNSIGNED NULL DEFAULT NULL AFTER `id`, ADD INDEX (`groupId`) ;
ALTER TABLE `sta_Partner` ADD FOREIGN KEY (`groupId`) REFERENCES `sta_PartnerGroup`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;


INSERT INTO `sta_PartnerGroup` (`id`, `title`, `sorter`, `added`, `changed`) VALUES
(1, 'Platinum Plus', 0, '2017-03-31 12:20:28', '2017-03-31 12:24:43'),
(2, 'Platinum', 1, '2017-03-31 12:23:02', '2017-03-31 12:24:43'),
(3, 'Gold', 2, '2017-03-31 12:23:07', '2017-03-31 12:24:43'),
(4, 'Silver', 3, '2017-03-31 12:23:12', '2017-03-31 12:24:43'),
(5, 'Entrepreneur Gold', 4, '2017-03-31 12:23:43', '2017-03-31 12:24:43'),
(6, 'Entrepreneur Silver', 5, '2017-03-31 12:23:51', '2017-03-31 12:24:43');
