/****** Object:  Script Date: 05/22/2015 21:26:52 ******/
ALTER TABLE [dbo].[PartnerTodo] ADD [ResponsibleUserId] [int] NULL
ALTER TABLE [dbo].[PartnerEvent] ADD [AffairFromDate] [datetime] NULL
ALTER TABLE [dbo].[PartnerEvent] ADD [AffairToDate] [datetime] NULL
ALTER TABLE [dbo].[PartnerEvent] ADD [AffairVoice] [varbinary](max) NULL
ALTER TABLE [dbo].[PartnerEvent] ADD [OwnerUserId] [int] NULL
ALTER TABLE [dbo].[PartnerEvent] ADD [VoiceFilePath] [nvarchar](256) NULL


/****** Object:  Table [dbo].[ContoUserChannel]    Script Date: 08/24/2016 12:29:56 ******/	
CREATE TABLE [dbo].[ContoUserChannel](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ContoUserId] [int] NOT NULL,
	[EmailChannel] [nvarchar](80) NULL,
	[SmsChannel] [nvarchar](50) NULL,
 CONSTRAINT [PK_ContoUserChannel] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

ALTER TABLE [dbo].[ContoUserChannel]  WITH CHECK ADD  CONSTRAINT [FK_ContoUserChannel_ContoUser] FOREIGN KEY([ContoUserId])
REFERENCES [dbo].[ContoUser] ([Id])
ON DELETE CASCADE
ALTER TABLE [dbo].[ContoUserChannel] CHECK CONSTRAINT [FK_ContoUserChannel_ContoUser]




/****** Szerződés beállítások funkciótér felvétele ******/
INSERT INTO [dbo].[FuncSpace] ([Name], Description, Allowed, TypeId) VALUES ('Clicxoft.Partner.Ugyfelszolgalat', 'Ügyfélszolgálat funkció', 'True', 1)




/****** Object:  Table [dbo].[ClicxoftDatabaseRevison]    Script Date: 05/22/2015 21:26:52 ******/
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ClicxoftDatabaseRevison]') AND type in (N'U'))
BEGIN
	SET ANSI_NULLS ON
	SET QUOTED_IDENTIFIER ON
	CREATE TABLE [dbo].[ClicxoftDatabaseRevison](
		[Revision] [int] NOT NULL,
		[ProductId] [int] NOT NULL,
		[Performed] [datetime] NOT NULL,
	 CONSTRAINT [pClicxoftDatabaseRevison] PRIMARY KEY CLUSTERED 
	(
		[Revision] ASC,
		[ProductId] ASC
	)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
	) ON [PRIMARY]
INSERT INTO [dbo].[TableType] (Id, [Name], IsAvatarOwner, IsFinanceLinkOwner) VALUES (1000, 'ClicxoftDatabaseRevison', 0, 0)
END


/****** Object:  Table [dbo].[ClicxoftDatabaseRevison]    Script Date: 05/22/2015 09:55:40 ******/
INSERT INTO [dbo].[ClicxoftDatabaseRevison] ([Revision], [ProductId], [Performed]) VALUES (1103, 11, '2016.08.23')