Index: branches/5.1.x/core/install/upgrades.sql
===================================================================
diff -u -r13545 -r13559
--- branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13545)
+++ branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13559)
@@ -1687,6 +1687,7 @@
 CREATE TABLE CachedUrls (
   UrlId int(11) NOT NULL AUTO_INCREMENT,
   Url varchar(255) NOT NULL DEFAULT '',
+  DomainId int(11) NOT NULL DEFAULT '0',
   `Hash` int(11) NOT NULL DEFAULT '0',
   Prefixes varchar(255) NOT NULL DEFAULT '',
   ParsedVars text NOT NULL,
@@ -1697,7 +1698,8 @@
   KEY `Hash` (`Hash`),
   KEY Prefixes (Prefixes),
   KEY Cached (Cached),
-  KEY LifeTime (LifeTime)
+  KEY LifeTime (LifeTime),
+  KEY DomainId (DomainId)
 );
 
 INSERT INTO ConfigurationAdmin VALUES ('CacheHandler', 'la_section_SettingsCaching', 'la_config_CacheHandler', 'select', NULL, 'Fake=la_None,Memcache=+Memcached,Apc=+Alternative PHP Cache,XCache=+XCache', 80.02, 0, 0);
@@ -1830,3 +1832,35 @@
 
 INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseContentLanguageNegotiation', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_UseContentLanguageNegotiation', 'checkbox', '', '', 10.023, 0, 0, NULL);
 INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SessionCookieDomains', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSession', 'la_config_SessionCookieDomains', 'textarea', '', 'rows="5" cols="40"', 20.021, 0, 0, NULL);
+
+CREATE TABLE SiteDomains (
+  DomainId int(11) NOT NULL AUTO_INCREMENT,
+  DomainName varchar(255) NOT NULL DEFAULT '',
+  DomainNameUsesRegExp tinyint(4) NOT NULL DEFAULT '0',
+  SSLUrl varchar(255) NOT NULL DEFAULT '',
+  SSLUrlUsesRegExp tinyint(4) NOT NULL DEFAULT '0',
+  AdminEmail varchar(255) NOT NULL DEFAULT '',
+  Country varchar(3) NOT NULL DEFAULT '',
+  PrimaryLanguageId int(11) NOT NULL DEFAULT '0',
+  Languages varchar(255) NOT NULL DEFAULT '',
+  PrimaryThemeId int(11) NOT NULL DEFAULT '0',
+  Themes varchar(255) NOT NULL DEFAULT '',
+  DomainIPRange text,
+  ExternalUrl varchar(255) NOT NULL DEFAULT '',
+  RedirectOnIPMatch tinyint(4) NOT NULL DEFAULT '0',
+  Priority int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (DomainId),
+  KEY DomainName (DomainName),
+  KEY DomainNameUsesRegExp (DomainNameUsesRegExp),
+  KEY SSLUrl (SSLUrl),
+  KEY SSLUrlUsesRegExp (SSLUrlUsesRegExp),
+  KEY AdminEmail (AdminEmail),
+  KEY Country (Country),
+  KEY PrimaryLanguageId (PrimaryLanguageId),
+  KEY Languages (Languages),
+  KEY PrimaryThemeId (PrimaryThemeId),
+  KEY Themes (Themes),
+  KEY ExternalUrl (ExternalUrl),
+  KEY RedirectOnIPMatch (RedirectOnIPMatch),
+  KEY Priority (Priority)
+);
