Index: trunk/admin/install/inportal_schema.sql
===================================================================
diff -u -N -r6583 -r7391
--- trunk/admin/install/inportal_schema.sql	(.../inportal_schema.sql)	(revision 6583)
+++ trunk/admin/install/inportal_schema.sql	(.../inportal_schema.sql)	(revision 7391)
@@ -13,111 +13,6 @@
 
 # --------------------------------------------------------
 
-CREATE TABLE Category (
-  CategoryId int(11) NOT NULL auto_increment,
-  `Type` int(11) NOT NULL default '0',
-  ParentId int(11) NOT NULL default '0',
-  Name varchar(255) NOT NULL default '',
-  l1_Name varchar(255) NOT NULL default '',
-  l2_Name varchar(255) NOT NULL default '',
-  l3_Name varchar(255) NOT NULL default '',
-  l4_Name varchar(255) NOT NULL default '',
-  l5_Name varchar(255) NOT NULL default '',
-  Filename varchar(255) NOT NULL default '',
-  AutomaticFilename tinyint(3) unsigned NOT NULL default '1',
-  Description text NOT NULL,
-  l1_Description text NOT NULL,
-  l2_Description text NOT NULL,
-  l3_Description text NOT NULL,
-  l4_Description text NOT NULL,
-  l5_Description text NOT NULL,
-  CreatedOn int(11) NOT NULL default '0',
-  EditorsPick tinyint(4) NOT NULL default '0',
-  `Status` tinyint(4) NOT NULL default '0',
-  Pop tinyint(4) default NULL,
-  Priority int(11) NOT NULL default '0',
-  MetaKeywords varchar(255) default NULL,
-  CachedDescendantCatsQty int(11) default NULL,
-  CachedNavbar text NOT NULL,
-  l1_CachedNavbar text NOT NULL,
-  l2_CachedNavbar text NOT NULL,
-  l3_CachedNavbar text NOT NULL,
-  l4_CachedNavbar text NOT NULL,
-  l5_CachedNavbar text NOT NULL,
-  CreatedById int(11) NOT NULL default '0',
-  ResourceId int(11) default NULL,
-  ParentPath text NOT NULL,
-  NamedParentPath text NOT NULL,
-  MetaDescription varchar(255) default NULL,
-  HotItem int(11) NOT NULL default '2',
-  NewItem int(11) NOT NULL default '2',
-  PopItem int(11) NOT NULL default '2',
-  Modified int(11) NOT NULL default '0',
-  ModifiedById int(11) NOT NULL default '0',
-  CategoryTemplate varchar(255) NOT NULL default '',
-  CachedCategoryTemplate varchar(255) NOT NULL default '',
-  PRIMARY KEY  (CategoryId),
-  UNIQUE KEY ResourceId (ResourceId),
-  KEY ParentId (ParentId),
-  KEY Modified (Modified),
-  KEY Priority (Priority),
-  KEY sorting (Name,Priority),
-  KEY Filename (Filename(5)),
-  KEY l1_Name (l1_Name(5)),
-  KEY l2_Name (l2_Name(5)),
-  KEY l3_Name (l3_Name(5)),
-  KEY l4_Name (l4_Name(5)),
-  KEY l5_Name (l5_Name(5)),
-  KEY l1_Description (l1_Description(5)),
-  KEY l2_Description (l2_Description(5)),
-  KEY l3_Description (l3_Description(5)),
-  KEY l4_Description (l4_Description(5)),
-  KEY l5_Description (l5_Description(5))
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE CategoryItems (
-  `CategoryId` int(11) NOT NULL default '0',
-  `ItemResourceId` int(11) NOT NULL default '0',
-  `PrimaryCat` tinyint(4) NOT NULL default '0',
-  `ItemPrefix` varchar(50) NOT NULL default '',
-  `Filename` varchar(255) NOT NULL default '',
-  UNIQUE KEY `CategoryId` (`CategoryId`,`ItemResourceId`),
-  KEY `PrimaryCat` (`PrimaryCat`),
-  KEY `ItemPrefix` (`ItemPrefix`),
-  KEY `Filename` (`Filename`(4))
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE ConfigurationAdmin (
-  VariableName varchar(80) NOT NULL default '',
-  heading varchar(255) default NULL,
-  prompt varchar(255) default NULL,
-  element_type varchar(20) NOT NULL default '',
-  validation varchar(255) default NULL,
-  ValueList text default NULL,
-  DisplayOrder double NOT NULL default '0',
-  GroupDisplayOrder double NOT NULL default '0',
-  Install int(11) NOT NULL default '1',
-  PRIMARY KEY  (VariableName)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE ConfigurationValues (
-  VariableId int(11) NOT NULL auto_increment,
-  VariableName varchar(255) NOT NULL default '',
-  VariableValue varchar(255) default NULL,
-  ModuleOwner varchar(20) default 'In-Portal',
-  Section varchar(255) NOT NULL default '',
-  PRIMARY KEY  (VariableId),
-  UNIQUE KEY VariableName (VariableName)
-)
-
-# --------------------------------------------------------
-
 CREATE TABLE CountCache (
   ListType int(11) NOT NULL default '0',
   ItemType int(11) NOT NULL default '-1',
@@ -131,66 +26,6 @@
 
 # --------------------------------------------------------
 
-CREATE TABLE CustomField (
-  CustomFieldId int(11) NOT NULL auto_increment,
-  Type int(11) NOT NULL default '0',
-  FieldName varchar(255) NOT NULL default '',
-  FieldLabel varchar(40) default NULL,
-  Heading varchar(60) default NULL,
-  Prompt varchar(60) default NULL,
-  ElementType varchar(50) NOT NULL default '',
-  ValueList varchar(255) default NULL,
-  DisplayOrder int(11) NOT NULL default '0',
-  OnGeneralTab tinyint(4) NOT NULL default '0',
-  IsSystem tinyint(3) unsigned NOT NULL default '0',
-  PRIMARY KEY  (CustomFieldId),
-  KEY Type (Type)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE EmailMessage (
-  EmailMessageId int(10) NOT NULL auto_increment,
-  Template longtext,
-  MessageType enum('html','text') NOT NULL default 'text',
-  LanguageId int(11) NOT NULL default '0',
-  EventId int(11) NOT NULL default '0',
-  PRIMARY KEY  (EmailMessageId)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE EmailQueue (
-  Subject text NOT NULL,
-  toaddr text NOT NULL,
-  fromaddr text NOT NULL,
-  message blob,
-  headers blob,
-  queued timestamp NOT NULL
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE EmailSubscribers (
-  EmailMessageId int(11) NOT NULL default '0',
-  PortalUserId int(11) NOT NULL default '0'
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE Events (
-  EventId int(11) NOT NULL auto_increment,
-  Event varchar(40) NOT NULL default '',
-  Enabled int(11) NOT NULL default '1',
-  FromUserId int(11) NOT NULL default '0',
-  Module varchar(40) NOT NULL default '',
-  Description varchar(255) NOT NULL default '',
-  Type int(11) NOT NULL default '0',
-  PRIMARY KEY  (EventId)
-)
-
-# --------------------------------------------------------
-
 CREATE TABLE Favorites (
   FavoriteId int(11) NOT NULL auto_increment,
   PortalUserId int(11) NOT NULL default '0',
@@ -203,12 +38,6 @@
 
 # --------------------------------------------------------
 
-CREATE TABLE IdGenerator (
-  lastid int(11) default NULL
-)
-
-# --------------------------------------------------------
-
 CREATE TABLE Images (
   ImageId int(11) NOT NULL auto_increment,
   ResourceId int(11) NOT NULL default '0',
@@ -279,171 +108,6 @@
 
 # --------------------------------------------------------
 
-CREATE TABLE Language (
-  LanguageId int(11) NOT NULL auto_increment,
-  PackName varchar(40) NOT NULL default '',
-  LocalName varchar(40) NOT NULL default '',
-  Enabled int(11) NOT NULL default '0',
-  PrimaryLang int(11) NOT NULL default '0',
-  IconURL varchar(255) default NULL,
-  DateFormat varchar(50) NOT NULL default '',
-  TimeFormat varchar(50) NOT NULL default '',
-  InputDateFormat varchar(50) NOT NULL default '',
-  InputTimeFormat varchar(50) NOT NULL default '',
-  DecimalPoint char(2) NOT NULL default '.',
-  ThousandSep tinytext NULL,
-  Charset varchar(20) NOT NULL default '',
-  UnitSystem tinyint(4) NOT NULL default '1',
-  PRIMARY KEY  (LanguageId)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE Modules (
-  Name varchar(255) NOT NULL default '',
-  Path varchar(255) NOT NULL default '',
-  Var varchar(10) NOT NULL default '',
-  Version varchar(10) NOT NULL default '',
-  Loaded tinyint(4) NOT NULL default '1',
-  LoadOrder tinyint(4) NOT NULL default '0',
-  TemplatePath varchar(255) NOT NULL default '',
-  RootCat int(11) NOT NULL default '0',
-  BuildDate double NOT NULL default '0',
-  PRIMARY KEY  (Name)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE PermCache (
-  PermCacheId int(11) NOT NULL auto_increment,
-  CategoryId int(11) NOT NULL default '0',
-  PermId int(11) NOT NULL default '0',
-  ACL varchar(255) NOT NULL default '',
-  DACL varchar(255) NOT NULL default '',
-  PRIMARY KEY  (PermCacheId),
-  KEY CategoryId (CategoryId),
-  KEY PermId (PermId)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE PermissionConfig (
-  PermissionConfigId int(11) NOT NULL auto_increment,
-  PermissionName varchar(30) NOT NULL default '',
-  Description varchar(255) NOT NULL default '',
-  ErrorMessage varchar(255) NOT NULL default '',
-  ModuleId varchar(20) NOT NULL default '0',
-  PRIMARY KEY  (PermissionConfigId),
-  KEY PermissionName (PermissionName)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE Permissions (
-  PermissionId int(11) NOT NULL auto_increment,
-  Permission varchar(255) NOT NULL default '',
-  GroupId int(11) default '0',
-  PermissionValue int(11) NOT NULL default '0',
-  Type tinyint(4) NOT NULL default '0',
-  CatId int(11) NOT NULL default '0',
-  PRIMARY KEY  (PermissionId),
-  UNIQUE KEY PermIndex (Permission,GroupId,CatId,Type)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE PersistantSessionData (
-  PortalUserId int(11) NOT NULL default '0',
-  VariableName varchar(255) NOT NULL default '',
-  VariableValue text NOT NULL,
-  PRIMARY KEY  (PortalUserId,VariableName),
-  KEY UserId (PortalUserId),
-  KEY VariableName (VariableName)
-)
-# --------------------------------------------------------
-
-CREATE TABLE Phrase (
-  Phrase varchar(255) NOT NULL default '',
-  Translation text NOT NULL default '',
-  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 '',
-  PRIMARY KEY  (PhraseId),
-  KEY LanguageId (LanguageId),
-  INDEX Phrase_Index (Phrase)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE PhraseCache (
-  Template varchar(40) NOT NULL default '',
-  PhraseList text NOT NULL,
-  CacheDate int(11) NOT NULL default '0',
-  ThemeId int(11) NOT NULL default '0',
-  StylesheetId int(10) unsigned NOT NULL default '0',
-  ConfigVariables text,
-  PRIMARY KEY  (Template)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE PortalGroup (
-  GroupId int(11) NOT NULL auto_increment,
-  Name varchar(255) NOT NULL default '',
-  Description varchar(255) default NULL,
-  CreatedOn double NOT NULL default '0',
-  System tinyint(4) NOT NULL default '0',
-  Personal tinyint(4) NOT NULL default '0',
-  Enabled tinyint(4) NOT NULL default '1',
-  ResourceId int(11) NOT NULL default '0',
-  PRIMARY KEY  (GroupId),
-  UNIQUE KEY Name (Name),
-  UNIQUE KEY ResourceId (ResourceId),
-  KEY Personal (Personal),
-  KEY Enabled (Enabled)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE PortalUser (
-  PortalUserId int(11) NOT NULL auto_increment,
-  Login varchar(255) default NULL,
-  `Password` varchar(255) default NULL,
-  FirstName varchar(255) default NULL,
-  LastName varchar(255) default NULL,
-  Company varchar(255) NOT NULL default '',
-  Email varchar(255) NOT NULL default '',
-  CreatedOn double NOT NULL default '0',
-  Phone varchar(20) default NULL,
-  Fax varchar(255) NOT NULL default '',
-  Street varchar(255) default NULL,
-  Street2 varchar(255) NOT NULL default '',
-  City varchar(20) default NULL,
-  State varchar(20) NOT NULL default '',
-  Zip varchar(20) default NULL,
-  Country varchar(20) NOT NULL default '',
-  ResourceId int(11) NOT NULL default '0',
-  `Status` tinyint(4) NOT NULL default '2',
-  Modified int(11) NOT NULL default '0',
-  dob double NOT NULL default '0',
-  tz int(11) default NULL,
-  ip varchar(20) default NULL,
-  IsBanned tinyint(1) NOT NULL default '0',
-  PassResetTime bigint(20) default NULL,
-  PwResetConfirm varchar(255) default NULL,
-  PwRequestTime bigint(25) default NULL,
-  MinPwResetDelay int(11) NOT NULL default '1800',
-  PRIMARY KEY  (PortalUserId),
-  UNIQUE KEY ResourceId (ResourceId),
-  UNIQUE KEY Login (Login),
-  KEY CreatedOn (CreatedOn)
-)
-
-# --------------------------------------------------------
-
 CREATE TABLE Relationship (
   RelationshipId int(11) NOT NULL auto_increment,
   SourceId int(11) default NULL,
@@ -502,17 +166,6 @@
 
 # --------------------------------------------------------
 
-CREATE TABLE SessionData (
-  SessionKey varchar(50) NOT NULL default '',
-  VariableName varchar(255) NOT NULL default '',
-  VariableValue text NOT NULL,
-  PRIMARY KEY  (SessionKey,VariableName),
-  KEY SessionKey (SessionKey),
-  KEY VariableName (VariableName)
-)
-
-# --------------------------------------------------------
-
 CREATE TABLE SpamControl (
   ItemResourceId int(11) NOT NULL default '0',
   IPaddress varchar(20) NOT NULL default '',
@@ -536,69 +189,6 @@
 
 # --------------------------------------------------------
 
-CREATE TABLE Theme (
-  ThemeId int(11) NOT NULL auto_increment,
-  Name varchar(40) NOT NULL default '',
-  Enabled int(11) NOT NULL default '1',
-  Description varchar(255) default NULL,
-  PrimaryTheme int(11) NOT NULL default '0',
-  CacheTimeout int(11) NOT NULL default '0',
-  StylesheetId INTEGER(10) UNSIGNED NOT NULL DEFAULT '0',
-  PRIMARY KEY  (ThemeId)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE ThemeFiles (
-  FileId int(11) NOT NULL auto_increment,
-  ThemeId int(11) NOT NULL default '0',
-  FileName varchar(255) NOT NULL default '',
-  FilePath varchar(255) NOT NULL default '',
-  Description varchar(255) default NULL,
-  FileType int(11) NOT NULL default '0',
-  PRIMARY KEY  (FileId),
-  KEY theme (ThemeId),
-  KEY FileName (FileName),
-  KEY FilePath (FilePath)
-)
-
-# --------------------------------------------------------
-
-CREATE TABLE UserGroup (
-  PortalUserId int(11) NOT NULL default '0',
-  GroupId int(11) NOT NULL default '0',
-  MembershipExpires int(10) unsigned default NULL,
-  PrimaryGroup tinyint(4) NOT NULL default '1',
-  ExpirationReminderSent tinyint(4) NOT NULL default '0',
-  PRIMARY KEY  (PortalUserId,GroupId),
-  KEY GroupId (GroupId),
-  KEY PrimaryGroup (PrimaryGroup)
-)
-
-# --------------------------------------------------------
-
-
-
-CREATE TABLE UserSession (
-  SessionKey varchar(50) NOT NULL default '',
-  CurrentTempKey varchar(50) default NULL,
-  PrevTempKey varchar(50) default NULL,
-  LastAccessed double NOT NULL default '0',
-  PortalUserId varchar(255) NOT NULL default '',
-  Language varchar(255) NOT NULL default '',
-  Theme varchar(255) NOT NULL default '',
-  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),
-  KEY UserId (PortalUserId),
-  KEY LastAccessed (LastAccessed)
-)
-
-# --------------------------------------------------------
-
 CREATE TABLE SuggestMail (
   email varchar(255) NOT NULL default '',
   sent double,
@@ -645,18 +235,6 @@
 
 # --------------------------------------------------------
 
-CREATE TABLE EmailLog (
-  EmailLogId int(11) NOT NULL auto_increment,
-  fromuser varchar(200) default NULL,
-  addressto varchar(255) default NULL,
-  subject varchar(255) default NULL,
-  timestamp bigint(20) default '0',
-  event varchar(100) default NULL,
-  PRIMARY KEY  (EmailLogId)
-)
-
-# --------------------------------------------------------
-
 CREATE TABLE ImportScripts (
   is_id smallint(5) unsigned NOT NULL auto_increment,
   is_Module varchar(50) NOT NULL default '',
@@ -672,15 +250,6 @@
 
 # --------------------------------------------------------
 
-CREATE TABLE Cache (
-  VarName varchar(255) NOT NULL default '',
-  Data longtext,
-  Cached int(11) default NULL,
-  LifeTime int(11) NOT NULL default '-1',
-  PRIMARY KEY  (VarName),
-  KEY Cached (Cached)
-)
-# --------------------------------------------------------
 CREATE TABLE StylesheetSelectors (
   SelectorId int(11) NOT NULL auto_increment,
   StylesheetId int(11) NOT NULL default '0',
@@ -693,28 +262,9 @@
   ParentId int(11) NOT NULL default '0',
   PRIMARY KEY  (SelectorId)
 )
-# --------------------------------------------------------
-CREATE TABLE Stylesheets (
-  StylesheetId int(11) NOT NULL auto_increment,
-  Name varchar(255) NOT NULL default '',
-  Description varchar(255) NOT NULL default '',
-  AdvancedCSS text NOT NULL,
-  LastCompiled int(10) unsigned NOT NULL default '0',
-  Enabled int(11) NOT NULL default '0',
-  PRIMARY KEY  (StylesheetId)
-)
-# --------------------------------------------------------
 
-CREATE TABLE StdDestinations (
-  DestId int(11) NOT NULL auto_increment,
-  DestType int(11) NOT NULL default '0',
-  DestParentId int(11) default NULL,
-  DestName varchar(255) NOT NULL default '',
-  DestAbbr char(3) NOT NULL default '',
-  DestAbbr2 char(2) default '',
-  PRIMARY KEY  (DestId)
-)
 # --------------------------------------------------------
+
 CREATE TABLE Visits (
   VisitId int(11) NOT NULL auto_increment,
   VisitDate int(10) unsigned NOT NULL default '0',
@@ -726,7 +276,9 @@
   KEY PortalUserId (PortalUserId),
   KEY AffiliateId (AffiliateId)
 )
+
 # --------------------------------------------------------
+
 CREATE TABLE ImportCache (
   CacheId int(11) NOT NULL auto_increment,
   CacheName varchar(255) NOT NULL default '',
@@ -736,18 +288,14 @@
   KEY CacheName (CacheName),
   KEY VarName (VarName)
 )
+
 # --------------------------------------------------------
-CREATE TABLE PortalUserCustomData (
-  CustomDataId int(11) NOT NULL auto_increment,
-  ResourceId int(10) unsigned NOT NULL default '0',
-  KEY ResourceId (ResourceId),
-  PRIMARY KEY  (CustomDataId)
-)
-# --------------------------------------------------------
+
 CREATE TABLE CategoryCustomData (
   CustomDataId int(11) NOT NULL auto_increment,
   ResourceId int(10) unsigned NOT NULL default '0',
   KEY ResourceId (ResourceId),
   PRIMARY KEY  (CustomDataId)
 )
+
 # --------------------------------------------------------
