Index: branches/5.1.x/core/install/install_schema.sql
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/install/install_schema.sql	(.../install_schema.sql)	(revision 12127)
+++ branches/5.1.x/core/install/install_schema.sql	(.../install_schema.sql)	(revision 12657)
@@ -48,7 +48,7 @@
   heading varchar(255) default NULL,
   prompt varchar(255) default NULL,
   element_type varchar(20) NOT NULL default '',
-  validation varchar(255) default NULL,
+  Validation text,
   ValueList text,
   DisplayOrder double NOT NULL default '0',
   GroupDisplayOrder double NOT NULL default '0',
@@ -107,14 +107,16 @@
   Event varchar(40) NOT NULL default '',
   ReplacementTags text,
   Enabled int(11) NOT NULL default '1',
-  FromUserId int(11) NOT NULL default '-1',
+  FrontEndOnly tinyint(3) unsigned NOT NULL default '0',
+  FromUserId int(11) default NULL,
   Module varchar(40) NOT NULL default '',
   Description varchar(255) NOT NULL default '',
-  Type int(11) NOT NULL default '0',
+  `Type` int(11) NOT NULL default '0',
   PRIMARY KEY  (EventId),
-  KEY Type (Type),
+  KEY `Type` (`Type`),
   KEY Enabled (Enabled),
-  KEY Event (Event)
+  KEY Event (Event),
+  KEY FrontEndOnly (FrontEndOnly)
 );
 
 CREATE TABLE IdGenerator (
@@ -175,18 +177,20 @@
 );
 
 CREATE TABLE Phrase (
-  Phrase varchar(255) NOT NULL default '',
+  Phrase varchar(255) NOT NULL DEFAULT '',
+  PhraseKey varchar(255) NOT NULL,
   Translation text NOT NULL,
-  PhraseType int(11) NOT NULL default '0',
-  PhraseId int(11) NOT NULL auto_increment,
-  LanguageId int(11) NOT NULL default '0',
-  LastChanged int(10) unsigned NOT NULL default '0',
-  LastChangeIP varchar(15) NOT NULL default '',
-  Module varchar(30) NOT NULL default 'In-Portal',
-  PRIMARY KEY  (PhraseId),
+  PhraseType int(11) NOT NULL DEFAULT '0',
+  PhraseId int(11) NOT NULL AUTO_INCREMENT,
+  LanguageId int(11) NOT NULL DEFAULT '0',
+  LastChanged int(10) unsigned NOT NULL DEFAULT '0',
+  LastChangeIP varchar(15) NOT NULL DEFAULT '',
+  Module varchar(30) NOT NULL DEFAULT 'In-Portal',
+  PRIMARY KEY (PhraseId),
   UNIQUE KEY LanguageId_2 (LanguageId,Phrase),
   KEY LanguageId (LanguageId),
-  KEY Phrase_Index (Phrase)
+  KEY Phrase_Index (Phrase),
+  KEY PhraseKey (PhraseKey)
 );
 
 CREATE TABLE PhraseCache (
@@ -318,21 +322,21 @@
 );
 
 CREATE TABLE UserSession (
-  SessionKey int(10) unsigned NOT NULL default '0',
-  CurrentTempKey int(10) unsigned default NULL,
-  PrevTempKey int(10) unsigned default NULL,
-  LastAccessed int(10) unsigned NOT NULL default '0',
-  PortalUserId int(11) NOT NULL default '-2',
-  `Language` int(11) NOT NULL default '1',
-  Theme int(11) NOT NULL default '1',
-  GroupId int(11) NOT NULL default '0',
-  IpAddress varchar(20) NOT NULL default '0.0.0.0',
-  `Status` int(11) NOT NULL default '1',
-  GroupList varchar(255) default NULL,
-  tz int(11) default NULL,
-  PRIMARY KEY  (SessionKey),
+  SessionKey int(10) unsigned NOT NULL DEFAULT '0',
+  LastAccessed int(10) unsigned NOT NULL DEFAULT '0',
+  PortalUserId int(11) NOT NULL DEFAULT '-2',
+  `Language` int(11) NOT NULL DEFAULT '1',
+  Theme int(11) NOT NULL DEFAULT '1',
+  GroupId int(11) NOT NULL DEFAULT '0',
+  IpAddress varchar(20) NOT NULL DEFAULT '0.0.0.0',
+  `Status` int(11) NOT NULL DEFAULT '1',
+  GroupList varchar(255) DEFAULT NULL,
+  tz int(11) DEFAULT NULL,
+  BrowserSignature varchar(32) NOT NULL,
+  PRIMARY KEY (SessionKey),
   KEY UserId (PortalUserId),
-  KEY LastAccessed (LastAccessed)
+  KEY LastAccessed (LastAccessed),
+  KEY BrowserSignature (BrowserSignature)
 );
 
 CREATE TABLE EmailLog (
@@ -412,7 +416,7 @@
   Modified int(11) NOT NULL default '0',
   ModifiedById int(11) NOT NULL default '0',
   CachedTemplate varchar(255) NOT NULL,
-  Template varchar(255) default NULL,
+  Template varchar(255) NOT NULL default '#inherit#',
   UseExternalUrl tinyint(3) unsigned NOT NULL default '0',
   ExternalUrl varchar(255) NOT NULL default '',
   UseMenuIconUrl tinyint(3) unsigned NOT NULL default '0',
