/*
	Update from DB Schema 1.0 to 1.3
	
	alter the Salvo table for:
			change Salvo_Description to NULL
	
	alter the ConfigIdentity table for:
			change ConfigIdentity_Description to NULL
	
	***This has been removed for Installshield upgrades- version 2.2, BG***
	         add Omnibus (ExportTo) tables:
		ExportTo, ETPLDetail, ETLSDetail, ETDevDetail
*/

use control

DECLARE @CONTROLDB varchar(30)
set @CONTROLDB = db_name()
print 'Using ' + @CONTROLDB

if (left(@CONTROLDB,7)<>'control')
begin
	print 'ERROR, active DB is ' + @CONTROLDB + ' (should be Control or equivalent)'
	DECLARE @errmsg0 varchar(128)
	set @errmsg0='Aborting, active DB is ' + @CONTROLDB
	raiserror(@errmsg0, 20, 1) with log
end
go


PRINT 'Altering Salvo table, change Salvo_Description to NULL OK' 
alter table Salvo
	alter column Salvo_Description varchar(255) NULL


PRINT 'Altering ConfigIdentity table, change ConfigIdentity_Description to NULL OK' 
alter table ConfigIdentity
	alter column ConfigIdentity_Description varchar(255) NULL

/* removed creation of Omnibus tables- no longer required BG*/


PRINT 'Inserting version information.'
INSERT INTO Version(Version_SVNumber, Version_Description) VALUES( 'SV0113-010300',	'Update of Envy release 1.0 to release 1.3 database schema.')

/**/
PRINT 'Script complete.'
