﻿PRINT N'Altering Table [dbo].[T_DKT_FELADAT]...';


GO

-- If not exists alter külön kérésre, ld. DB-4276
IF (COL_LENGTH('dbo.T_DKT_FELADAT', 'C_NYELVID') IS NULL) BEGIN ALTER TABLE [dbo].[T_DKT_FELADAT] ADD [C_NYELVID]  NVARCHAR (2) NULL END
IF (COL_LENGTH('dbo.T_DKT_FELADAT', 'C_PARENTID') IS NULL) BEGIN ALTER TABLE [dbo].[T_DKT_FELADAT] ADD [C_PARENTID] INT NULL END
IF (COL_LENGTH('dbo.T_DKT_FELADAT', 'C_ROGZITORENDSZERID') IS NULL) BEGIN ALTER TABLE [dbo].[T_DKT_FELADAT] ADD [C_ROGZITORENDSZERID] INT NULL END
IF (COL_LENGTH('dbo.T_DKT_FELADAT', 'C_XEROPANASSIGNMENTID') IS NULL) BEGIN ALTER TABLE [dbo].[T_DKT_FELADAT] ADD [C_XEROPANASSIGNMENTID] INT NULL END
IF (COL_LENGTH('dbo.T_DKT_FELADAT', 'C_XEROPANBUNDLEID') IS NULL) BEGIN ALTER TABLE [dbo].[T_DKT_FELADAT] ADD [C_XEROPANBUNDLEID] INT NULL END
IF (COL_LENGTH('dbo.T_DKT_FELADAT', 'C_XEROPANLESSONID') IS NULL) BEGIN ALTER TABLE [dbo].[T_DKT_FELADAT] ADD [C_XEROPANLESSONID] INT NULL END
IF (COL_LENGTH('dbo.T_DKT_FELADAT', 'C_XEROPANTOROLT') IS NULL) BEGIN ALTER TABLE [dbo].[T_DKT_FELADAT] ADD [C_XEROPANTOROLT] CHAR (1) DEFAULT ('F') NOT NULL END


GO
PRINT N'Altering Table [dbo].[T_GONDVISELO]...';


GO
ALTER TABLE [dbo].[T_GONDVISELO]
    ADD [C_ANYJAUTONEV]         NVARCHAR (255) NULL,
        [C_ANYJAVEZETEKNEV]     NVARCHAR (255) NULL,
        [C_ELOTAG]              NVARCHAR (20)  NULL,
        [C_SZULETESIDATUM]      DATETIME       NULL,
        [C_SZULETESIHELY]       NVARCHAR (255) NULL,
        [C_SZULETESIUTONEV]     NVARCHAR (255) NULL,
        [C_SZULETESIVEZETEKNEV] NVARCHAR (255) NULL,
        [C_UTONEV]              NVARCHAR (255) NULL,
        [C_VEZETEKNEV]          NVARCHAR (255) NULL;



GO

EXECUTE dev.uspCreateSchemaViews 'T_DKT_FELADAT, T_GONDVISELO'
EXECUTE dev.sp_Global_GenerateAsyncAuditTriggerAll
GO

ALTER QUEUE auditLog.[AuditQueue]
WITH ACTIVATION 
(
  STATUS =  ON,
  PROCEDURE_NAME =  auditLog.usp_AuditProcessing,
  MAX_QUEUE_READERS =  10,
  EXECUTE AS 'Kreta_tech_user'
);
GO

PRINT N'Update complete.';

GO