ALTER TABLE TopicCustomData ADD INDEX (ResourceId);
UPDATE ItemTypes SET ClassName = '' WHERE ItemType = 30;

INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.delete', 11, 1, 1, 0);

UPDATE ConfigurationAdmin SET ValueList = 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,<SQL>SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM <PREFIX>CustomField WHERE (Type = 3) AND (IsSystem = 0)</SQL>' WHERE VariableName IN ('Topic_SortField', 'Topic_SortField2');

UPDATE Modules SET Version = '1.2.0' WHERE Name = 'In-Bulletin';