ALTER TABLE LinkCustomData ADD INDEX (ResourceId);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.delete', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:approve', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:decline', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.view', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.add', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.edit', 11, 1, 1, 0);
INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.delete', 11, 1, 1, 0);

UPDATE ConfigurationAdmin SET ValueList = 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,<SQL>SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM <PREFIX>CustomField WHERE (Type = 4) AND (IsSystem = 0)</SQL>' WHERE VariableName IN ('Link_SortField', 'Link_SortField2');

UPDATE Modules SET Version = '3.2.0' WHERE Name = 'In-Link';