-- CHANGE "ELEMENTS" OF "FIELD "socialType" --------------------
ALTER TABLE `smd__post_template` MODIFY `socialType` Enum( 'facebook', 'twitter', 'instagram', 'linkedIn' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
-- -------------------------------------------------------------

-- CHANGE "ELEMENTS" OF "FIELD "socialType" --------------------
ALTER TABLE `smd__social_site` MODIFY `socialType` Enum( 'facebook', 'linkedIn' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
-- -------------------------------------------------------------

-- CHANGE "LENGTH" OF "FIELD "pageAccessToken" -----------------
ALTER TABLE `smd__social_site` MODIFY `pageAccessToken` VarChar( 1000 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
-- -------------------------------------------------------------

-- CREATE FIELD "socialChannel" -------------------------------
ALTER TABLE `cms__file_static` ADD COLUMN `socialChannel` Set( 'facebook', 'linkedIn' ) NULL;
-- -------------------------------------------------------------

-- CREATE FIELD "socialChannel" --------------------------------
ALTER TABLE `smd__carousel` ADD COLUMN `socialChannel` Set( 'facebook', 'linkedIn' ) NULL;
-- -------------------------------------------------------------

INSERT INTO `cms__resource` (`resourceID`, `moduleID`, `name`, `description`) VALUES ('analytics.analytics.pagePostLikes', 9, 'analytics.analytics.pagePostLikes.name', 'analytics.analytics.pagePostLikes.description');
INSERT INTO `cms__resource` (`resourceID`, `moduleID`, `name`, `description`) VALUES ('analytics.analytics.pagePostComments', 9, 'analytics.analytics.pagePostComments.name', 'analytics.analytics.pagePostComments.description');
INSERT INTO `cms__resource` (`resourceID`, `moduleID`, `name`, `description`) VALUES ('analytics.analytics.interactions', 9, 'analytics.analytics.interactions.name', 'analytics.analytics.interactions.description');
INSERT INTO `cms__resource` (`resourceID`, `moduleID`, `name`, `description`) VALUES ('analytics.analytics.mentions', 9, 'analytics.analytics.mentions.name', 'analytics.analytics.mentions.description');
INSERT INTO `cms__resource` (`resourceID`, `moduleID`, `name`, `description`) VALUES ('analytics.analytics.pagePostShares', 9, 'analytics.analytics.pagePostShares.name', 'analytics.analytics.pagePostShares.description');

# insert into smd__organization_role_has_resources (roleID, resourceID) select roleID, 'új resource id' as resourceID from smd__organization_role WHERE roleID NOT LIKE '%.creator.%'
insert into smd__organization_role_has_resources (roleID, resourceID) select roleID, 'analytics.analytics.pagePostLikes' as resourceID from smd__organization_role WHERE roleID NOT LIKE '%.creator.%';
insert into smd__organization_role_has_resources (roleID, resourceID) select roleID, 'analytics.analytics.pagePostComments' as resourceID from smd__organization_role WHERE roleID NOT LIKE '%.creator.%';
insert into smd__organization_role_has_resources (roleID, resourceID) select roleID, 'analytics.analytics.interactions' as resourceID from smd__organization_role WHERE roleID NOT LIKE '%.creator.%';
insert into smd__organization_role_has_resources (roleID, resourceID) select roleID, 'analytics.analytics.mentions' as resourceID from smd__organization_role WHERE roleID NOT LIKE '%.creator.%';
insert into smd__organization_role_has_resources (roleID, resourceID) select roleID, 'analytics.analytics.pagePostShares' as resourceID from smd__organization_role WHERE roleID NOT LIKE '%.creator.%';