
/*Droping no used user*/
IF  EXISTS (SELECT * FROM dbo.sysusers WHERE name = N'HcUser')
BEGIN 
	ALTER AUTHORIZATION ON SCHEMA::db_owner TO db_owner
	DROP USER HcUser

END

/*
This script is for Db init after creation
This script will allways run first thing during Db install
*/

	--Create DB Version table if not exists
	IF  NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DbVersion]') AND type in (N'U'))
	Begin
		CREATE TABLE [dbo].[DbVersion]
		(
			[Id] INT NOT NULL IDENTITY(1,1) PRIMARY KEY, 
			[Major] INT NOT NULL, 
			[Minor] INT NOT NULL, 
			[Build] INT NOT NULL, 
			[Revision] INT NOT NULL, 
			[UpdateDate] DATETIME NOT NULL DEFAULT GetUtcDate()
		)
	END





