# ===== v 4.0.1 =====
ALTER TABLE EmailLog ADD EventParams TEXT NOT NULL;

INSERT INTO ConfigurationAdmin VALUES ('MailFunctionHeaderSeparator', 'la_Text_smtp_server', 'la_config_MailFunctionHeaderSeparator', 'radio', NULL, '1=la_Linux,2=la_Windows', 30.08, 0, 0);
INSERT INTO ConfigurationValues VALUES (0, 'MailFunctionHeaderSeparator', 1, 'In-Portal', 'in-portal:configure_general');

ALTER TABLE PersistantSessionData DROP PRIMARY KEY ;
ALTER TABLE PersistantSessionData ADD INDEX ( `PortalUserId` ) ;

# ===== v 4.0.2 =====
ALTER TABLE EmailMessage ADD ReplacementTags TEXT AFTER Template;
ALTER TABLE Phrase CHANGE Translation Translation TEXT NOT NULL;
ALTER TABLE Category
	CHANGE Description Description TEXT,
	CHANGE l1_Description l1_Description TEXT,
	CHANGE l2_Description l2_Description TEXT,
	CHANGE l3_Description l3_Description TEXT,
	CHANGE l4_Description l4_Description TEXT,
	CHANGE l5_Description l5_Description TEXT,
	CHANGE CachedNavbar CachedNavbar text,
	CHANGE l1_CachedNavbar l1_CachedNavbar text,
	CHANGE l2_CachedNavbar l1_CachedNavbar text,
	CHANGE l3_CachedNavbar l1_CachedNavbar text,
	CHANGE l4_CachedNavbar l1_CachedNavbar text,
	CHANGE l5_CachedNavbar l1_CachedNavbar text;
                                
ALTER TABLE ConfigurationAdmin CHANGE ValueList ValueList TEXT;

ALTER TABLE EmailQueue
	CHANGE `Subject` `Subject` TEXT,
	CHANGE toaddr toaddr TEXT,
	CHANGE fromaddr fromaddr TEXT;
	
ALTER TABLE Category DROP Pop;

ALTER TABLE PortalUser
	CHANGE CreatedOn CreatedOn INT DEFAULT NULL,
	CHANGE dob dob INT(11) NULL DEFAULT NULL,
	CHANGE PassResetTime PassResetTime INT(11) UNSIGNED NULL DEFAULT NULL,
	CHANGE PwRequestTime PwRequestTime INT(11) UNSIGNED NULL DEFAULT NULL,
	CHANGE `Password` `Password` VARCHAR(255) NULL DEFAULT 'd41d8cd98f00b204e9800998ecf8427e';

ALTER TABLE Modules
	CHANGE BuildDate BuildDate INT UNSIGNED NULL DEFAULT NULL,
	CHANGE Version Version VARCHAR(10) NOT NULL DEFAULT '0.0.0';
	
ALTER TABLE Language
	CHANGE Enabled Enabled INT(11) NOT NULL DEFAULT '1',
	CHANGE InputDateFormat InputDateFormat VARCHAR(50) NOT NULL DEFAULT 'm/d/Y',
	CHANGE InputTimeFormat InputTimeFormat VARCHAR(50) NOT NULL DEFAULT 'g:i:s A',
	CHANGE DecimalPoint DecimalPoint CHAR(2) NOT NULL DEFAULT '',
	CHANGE ThousandSep ThousandSep TINYTEXT NOT NULL DEFAULT '';
	
ALTER TABLE Events CHANGE FromUserId FromUserId INT(11) NOT NULL DEFAULT '-1';

ALTER TABLE StdDestinations CHANGE DestAbbr2 DestAbbr2 CHAR(2) NULL DEFAULT NULL;

ALTER TABLE PermCache DROP DACL;
