if exists(select * from sys.indexes i where i.[object_id] = OBJECT_ID('VCLib.T_ENTITIES', 'U') and i.name = 'UIX_T_ENTITIES_EntName_Schema')
	DROP INDEX UIX_T_ENTITIES_EntName_Schema ON VCLib.T_ENTITIES
go

CREATE UNIQUE INDEX UIX_T_ENTITIES_EntName_Schema ON VCLib.T_ENTITIES(EntName, [Schema])
go

if exists(select * from sys.indexes i where i.[object_id] = OBJECT_ID('vclib.t_login', 'U') and i.name = 'UIX_T_LOGIN_Login_AuthenticationType')
	DROP INDEX UIX_T_LOGIN_Login_AuthenticationType ON vclib.t_login
go

create unique index UIX_T_LOGIN_Login_AuthenticationType on vclib.t_login ([login],	AuthenticationType)
go

if exists(select * from sys.indexes i where i.[object_id] = OBJECT_ID('VCLib.T_WEB_APP', 'U') and i.name = 'UIX_T_WEB_APP_Name')
	DROP INDEX UIX_T_WEB_APP_Name ON [VCLib].[T_WEB_APP]
go

CREATE UNIQUE INDEX [UIX_T_WEB_APP_Name] ON [VCLib].[T_WEB_APP] ([Name] ASC)
go

if exists(select * from sys.indexes i where i.[object_id] = OBJECT_ID('VCLib.T_ENTITIES_WEB_ALIAS', 'U') and i.name = 'UIX_T_ENTITIES_WEB_ALIAS_Alias_WebApp')
	DROP INDEX UIX_T_ENTITIES_WEB_ALIAS_Alias_WebApp ON [VCLib].[T_ENTITIES_WEB_ALIAS]
go

CREATE UNIQUE INDEX [UIX_T_ENTITIES_WEB_ALIAS_Alias_WebApp] ON [VCLib].[T_ENTITIES_WEB_ALIAS] ([Alias] ASC, [WebApp] ASC)
go

if exists(select * from sys.indexes i where i.[object_id] = OBJECT_ID('VCLib.T_DTO_MODEL', 'U') and i.name = 'UIX_T_DTO_MODEL_WebApp_Entities_Name')
	DROP INDEX UIX_T_DTO_MODEL_WebApp_Entities_Name ON [VCLib].[T_DTO_MODEL]
go

CREATE UNIQUE INDEX [UIX_T_DTO_MODEL_WebApp_Entities_Name] ON [VCLib].[T_DTO_MODEL] ([Entities] ASC, [Name] ASC, [WebApp] ASC)
go

if exists(select * from sys.indexes i where i.[object_id] = OBJECT_ID('VCLib.T_SHORTCUTCOMMAND', 'U') and i.name = 'UIX_T_SHORTCUTCOMMAND_UserId_CommandName_FormType_Context')
	DROP INDEX UIX_T_SHORTCUTCOMMAND_UserId_CommandName_FormType_Context ON VCLib.T_SHORTCUTCOMMAND
go

create unique index UIX_T_SHORTCUTCOMMAND_UserId_CommandName_FormType_Context on VCLib.T_SHORTCUTCOMMAND (UserId, CommandName, FormType, Context)
go

if exists(select * from sys.indexes i where i.[object_id] = OBJECT_ID('VCLib.T_HOLDER_PARAMETER', 'U') and i.name = 'UIX_T_HOLDER_PARAMETER_Holder_ParameterName')
	DROP INDEX UIX_T_HOLDER_PARAMETER_Holder_ParameterName ON VCLib.T_HOLDER_PARAMETER
go

create unique index UIX_T_HOLDER_PARAMETER_Holder_ParameterName on VCLib.T_HOLDER_PARAMETER (Holder ASC, ParameterName ASC)
go

if exists(select * from sys.indexes i where i.[object_id] = OBJECT_ID('VCLib.T_MACHINE_CONFIG', 'U') and i.name = 'UIX_T_MACHINE_CONFIG_MachineName')
	DROP INDEX UIX_T_MACHINE_CONFIG_MachineName ON VCLib.T_MACHINE_CONFIG
go

create unique index UIX_T_MACHINE_CONFIG_MachineName on VCLib.T_MACHINE_CONFIG (MachineName ASC)
go