INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_MaxImageCount', 5, 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageWidth', 120, 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageHeight', 120, 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageWidth', 450, 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageHeight', 450, 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UsePageHitCounter', 0, 'In-Portal', 'in-portal:configure_general');
INSERT INTO Counters VALUES (DEFAULT, 'members_count', 'SELECT COUNT(*) FROM <%PREFIX%>PortalUser WHERE Status = 1', NULL , NULL , '3600', '0', '|PortalUser|');
INSERT INTO Counters VALUES (DEFAULT, 'members_online', 'SELECT COUNT(*) FROM <%PREFIX%>UserSession WHERE PortalUserId > 0', NULL , NULL , '3600', '0', '|UserSession|');
INSERT INTO Counters VALUES (DEFAULT, 'guests_online', 'SELECT COUNT(*) FROM <%PREFIX%>UserSession WHERE PortalUserId <= 0', NULL , NULL , '3600', '0', '|UserSession|');
INSERT INTO Counters VALUES (DEFAULT, 'users_online', 'SELECT COUNT(*) FROM <%PREFIX%>UserSession', NULL , NULL , '3600', '0', '|UserSession|');
CREATE TABLE ChangeLogs (ChangeLogId bigint(20) NOT NULL auto_increment, PortalUserId int(11) NOT NULL default '0', SessionLogId int(11) NOT NULL default '0', `Action` tinyint(4) NOT NULL default '0', OccuredOn int(11) NOT NULL default '0', Prefix varchar(255) NOT NULL default '', ItemId bigint(20) NOT NULL default '0', Changes text NOT NULL, MasterPrefix varchar(255) NOT NULL default '', MasterId bigint(20) NOT NULL default '0', PRIMARY KEY (ChangeLogId), KEY PortalUserId (PortalUserId), KEY SessionLogId (SessionLogId), KEY `Action` (`Action`), KEY OccuredOn (OccuredOn), KEY Prefix (Prefix), KEY MasterPrefix (MasterPrefix));
CREATE TABLE SessionLogs (SessionLogId bigint(20) NOT NULL auto_increment, PortalUserId int(11) NOT NULL default '0', SessionId int(10) NOT NULL default '0', `Status` tinyint(4) NOT NULL default '1', SessionStart int(11) NOT NULL default '0', SessionEnd int(11) default NULL, IP varchar(15) NOT NULL default '', AffectedItems int(11) NOT NULL default '0', PRIMARY KEY (SessionLogId), KEY SessionId (SessionId), KEY `Status` (`Status`), KEY PortalUserId (PortalUserId));
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PageHitCounter', 0, 'In-Portal', 'in-portal:configure_general');
ALTER TABLE CustomField ADD INDEX (MultiLingual), ADD INDEX (DisplayOrder), ADD INDEX (OnGeneralTab), ADD INDEX (IsSystem);
ALTER TABLE ConfigurationAdmin ADD INDEX (DisplayOrder), ADD INDEX (GroupDisplayOrder), ADD INDEX (Install);
ALTER TABLE EmailSubscribers ADD INDEX (EmailMessageId), ADD INDEX (PortalUserId);
ALTER TABLE Events ADD INDEX (`Type`), ADD INDEX (Enabled);
ALTER TABLE Language ADD INDEX (Enabled), ADD INDEX (PrimaryLang), ADD INDEX (AdminInterfaceLang), ADD INDEX (Priority);
ALTER TABLE Modules ADD INDEX (Loaded), ADD INDEX (LoadOrder);
ALTER TABLE PhraseCache ADD INDEX (CacheDate), ADD INDEX (ThemeId), ADD INDEX (StylesheetId);
ALTER TABLE PortalGroup ADD INDEX (CreatedOn);
ALTER TABLE PortalUser ADD INDEX (Status), ADD INDEX (Modified), ADD INDEX (dob), ADD INDEX (IsBanned);
ALTER TABLE Theme ADD INDEX (Enabled), ADD INDEX (StylesheetId), ADD INDEX (PrimaryTheme);
ALTER TABLE UserGroup ADD INDEX (MembershipExpires), ADD INDEX (ExpirationReminderSent);
ALTER TABLE EmailLog ADD INDEX (`timestamp`);
ALTER TABLE StdDestinations ADD INDEX (DestType), ADD INDEX (DestParentId);
ALTER TABLE Category ADD INDEX (Status), ADD INDEX (CreatedOn), ADD INDEX (EditorsPick);
ALTER TABLE Stylesheets ADD INDEX (Enabled), ADD INDEX (LastCompiled);
ALTER TABLE Counters ADD INDEX (IsClone), ADD INDEX (LifeTime), ADD INDEX (LastCounted);
ALTER TABLE Skins ADD INDEX (IsPrimary), ADD INDEX (LastCompiled);
ALTER TABLE BanRules ADD INDEX (Status), ADD INDEX (Priority), ADD INDEX (ItemType);
ALTER TABLE Favorites ADD INDEX (Modified), ADD INDEX (ItemTypeId);
ALTER TABLE Images ADD INDEX (Priority), ADD INDEX (Enabled);
ALTER TABLE ItemRating ADD INDEX (CreatedOn), ADD INDEX (ItemId), ADD INDEX (RatingValue);
ALTER TABLE ItemReview ADD INDEX (CreatedOn), ADD INDEX (ItemId), ADD INDEX (ItemType), ADD INDEX (Priority), ADD INDEX (Status);
ALTER TABLE ItemFiles ADD INDEX (CreatedOn), ADD INDEX (Status);
ALTER TABLE Relationship ADD INDEX (`Type`), ADD INDEX (Enabled), ADD INDEX (Priority), ADD INDEX (SourceType), ADD INDEX (TargetType);
ALTER TABLE SearchConfig ADD INDEX (SimpleSearch), ADD INDEX (AdvancedSearch), ADD INDEX (DisplayOrder), ADD INDEX (Priority), ADD INDEX (CustomFieldId);
ALTER TABLE SearchLog ADD INDEX (SearchType);
ALTER TABLE SpamControl ADD INDEX (PortalUserId), ADD INDEX (Expire), ADD INDEX (ItemResourceId);
ALTER TABLE StatItem ADD INDEX (AdminSummary), ADD INDEX (Priority);
ALTER TABLE SuggestMail ADD INDEX (sent);
ALTER TABLE TagAttributes ADD INDEX (TagId);
ALTER TABLE ImportScripts ADD INDEX (is_enabled);
ALTER TABLE StylesheetSelectors ADD INDEX (StylesheetId), ADD INDEX (ParentId), ADD INDEX (`Type`);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseSmallHeader', '0', 'In-Portal', 'in-portal:configure_general');
INSERT INTO ConfigurationAdmin VALUES ('User_Default_Registration_Country', 'la_Text_General', 'la_config_DefaultRegistrationCountry', 'select', NULL , '=+,<SQL>SELECT DestName AS OptionName, DestId AS OptionValue FROM <PREFIX>StdDestinations WHERE DestParentId IS NULL Order BY OptionName</SQL>', 10.111, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'User_Default_Registration_Country', '', 'In-Portal:Users', 'in-portal:configure_users');
ALTER TABLE Category ADD SymLinkCategoryId INT UNSIGNED NULL DEFAULT NULL AFTER `Type`, ADD INDEX (SymLinkCategoryId);
ALTER TABLE ConfigurationValues CHANGE VariableValue VariableValue TEXT NULL DEFAULT NULL;
ALTER TABLE Language
ADD AdminInterfaceLang TINYINT UNSIGNED NOT NULL AFTER PrimaryLang,
ADD Priority INT NOT NULL AFTER AdminInterfaceLang;
UPDATE Language SET AdminInterfaceLang = 1 WHERE PrimaryLang = 1;
DELETE FROM PersistantSessionData WHERE VariableName = 'lang_columns_.';
ALTER TABLE SessionData CHANGE VariableValue VariableValue longtext NOT NULL;