
PRINT N'Dropping Table [dbo].[DataModels]...';

GO
DROP TABLE [dbo].[DataModels];

GO
PRINT N'Dropping Function [dbo].[fAbmormalFindingsHealthIndicator]...';


GO
DROP FUNCTION [dbo].[fAbmormalFindingsHealthIndicator];

GO
PRINT N'Dropping Function [sCommon].[fSplitStringToTable]...';


GO
DROP FUNCTION [sCommon].[fSplitStringToTable];


GO
PRINT N'Dropping Procedure [sExamination].[pAddTokenUtilization]...';


GO
DROP PROCEDURE [sExamination].[pAddTokenUtilization];


GO
PRINT N'Dropping Procedure [sExamination].[pUpsertAISuggestion]...';


GO
DROP PROCEDURE [sExamination].[pUpsertAISuggestion];


GO
PRINT N'Dropping Table [sCommon].[tTokenUtilization]...';


GO
DROP TABLE [sCommon].[tTokenUtilization];


GO
PRINT N'Dropping Table [sExamination].[tAISuggestions]...';


GO
DROP TABLE [sExamination].[tAISuggestions];


GO
PRINT N'Creating Schema [sWellness]...';


GO
CREATE SCHEMA [sWellness];


GO
PRINT N'Creating User-Defined Table Type [sWellness].[ProgramCustomFieldTableType]...';


GO
CREATE TYPE [sWellness].[ProgramCustomFieldTableType] AS TABLE (
    [Id]              INT            NULL,
    [FieldTypeId]     TINYINT        NULL,
    [FieldTitle]      NVARCHAR (250) NULL,
    [FieldList]       NVARCHAR (MAX) NULL,
    [IsMandatory]     BIT            NULL,
    [FieldOrderIndex] INT            NULL);


GO
PRINT N'Creating User-Defined Table Type [sWellness].[ProgramCustomFieldResponseTableType]...';


GO
CREATE TYPE [sWellness].[ProgramCustomFieldResponseTableType] AS TABLE (
    [ProgramParticipantId]    BIGINT         NULL,
    [ProgramCustomFieldId]    INT            NULL,
    [ProgramCustomFieldValue] NVARCHAR (MAX) NULL);


GO
PRINT N'Creating User-Defined Table Type [sWellness].[udt_ProgramCoachTableType]...';


GO
CREATE TYPE [sWellness].[udt_ProgramCoachTableType] AS TABLE (
    [DoctorEmployeeId] BIGINT NULL);


GO
PRINT N'Creating User-Defined Table Type [sWellness].[udt_ProgramLocationTableType]...';


GO
CREATE TYPE [sWellness].[udt_ProgramLocationTableType] AS TABLE (
    [LocationId] INT NULL);


GO
PRINT N'Creating User-Defined Table Type [sWellness].[udt_ProgramCustomFieldTableType]...';


GO
CREATE TYPE [sWellness].[udt_ProgramCustomFieldTableType] AS TABLE (
    [Id]              INT             NULL,
    [FieldTitle]      NVARCHAR (250)  NULL,
    [FieldRemark]     NVARCHAR (2000) NULL,
    [FieldTypeId]     TINYINT         NULL,
    [FieldList]       NVARCHAR (MAX)  NULL,
    [IsMandatory]     BIT             NULL,
    [FieldOrderIndex] INT             NULL);


GO
PRINT N'Creating User-Defined Table Type [sWellness].[ProgramAttendanceTableType]...';


GO
CREATE TYPE [sWellness].[ProgramAttendanceTableType] AS TABLE (
    [ProgramParticipantId] BIGINT NULL,
    [IsPresent]            BIT    NULL);


GO
PRINT N'Altering Table [sAlert].[tAlertLog]...';


GO
ALTER TABLE [sAlert].[tAlertLog]
    ADD [ClaimIntimationDetailId] BIGINT NULL;


GO
PRINT N'Altering Table [sAppointment].[tTimeSlotSetup]...';


GO
ALTER TABLE [sAppointment].[tTimeSlotSetup]
    ADD [ServiceId] BIGINT NULL;


GO
PRINT N'Altering Table [sCwb].[tDoctorMaster]...';


GO
ALTER TABLE [sCwb].[tDoctorMaster]
    ADD [IsWellness] BIT NULL;


GO
PRINT N'Altering Table [sExamination].[tCauseMaster]...';


GO
ALTER TABLE [sExamination].[tCauseMaster]
    ADD [IsWellness] BIT NULL;


GO
PRINT N'Altering Table [sExamination].[tOPD]...';


GO
ALTER TABLE [sExamination].[tOPD]
    ADD [MobileNumber] NVARCHAR (50) NULL;


GO
PRINT N'Altering Table [sHospitalization].[tIntimationDetails]...';


GO
ALTER TABLE [sHospitalization].[tIntimationDetails]
    ADD [TreatingDoctor] NVARCHAR (100) NULL,
        [Flag]           BIT            CONSTRAINT [DF_tIntimationDetails_Flag] DEFAULT ((0)) NULL;


GO
PRINT N'Creating Table [sWellness].[tWellnessAppointmentDocuments]...';


GO
CREATE TABLE [sWellness].[tWellnessAppointmentDocuments] (
    [Id]                  INT            IDENTITY (1, 1) NOT NULL,
    [AppointmentId]       BIGINT         NOT NULL,
    [FileName]            NVARCHAR (100) NULL,
    [ConfigurationTypeId] SMALLINT       NOT NULL,
    [IsObsolete]          BIT            NOT NULL,
    [CreatedDateTime]     DATETIME       NULL,
    [CreatedUserId]       BIGINT         NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC) WITH (FILLFACTOR = 85)
);


GO
PRINT N'Creating Table [sWellness].[tProgramTypeMaster]...';


GO
CREATE TABLE [sWellness].[tProgramTypeMaster] (
    [Id]              INT            IDENTITY (1, 1) NOT NULL,
    [Title]           NVARCHAR (100) NOT NULL,
    [Code]            NVARCHAR (100) NOT NULL,
    [IsObsolete]      BIT            NOT NULL,
    [OrgId]           SMALLINT       NOT NULL,
    [CreatedUserId]   BIGINT         NOT NULL,
    [CreatedDateTime] DATETIME       NOT NULL,
    [UpdatedUserId]   BIGINT         NULL,
    [UpdatedDateTime] DATETIME       NULL,
    CONSTRAINT [PK_sWellness]].[tProgramTypeMaster] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramSubTypeMaster]...';


GO
CREATE TABLE [sWellness].[tProgramSubTypeMaster] (
    [Id]                  INT            IDENTITY (1, 1) NOT NULL,
    [ProgramTypeMasterId] INT            NOT NULL,
    [Title]               NVARCHAR (100) NOT NULL,
    [Code]                NVARCHAR (100) NOT NULL,
    [IsObsolete]          BIT            NOT NULL,
    [OrgId]               SMALLINT       NOT NULL,
    [CreatedUserId]       BIGINT         NOT NULL,
    [CreatedDateTime]     DATETIME       NOT NULL,
    [UpdatedUserId]       BIGINT         NULL,
    [UpdatedDateTime]     DATETIME       NULL,
    CONSTRAINT [PK_sWellness]].[tProgramSubTypeMaster] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramMaster]...';


GO
CREATE TABLE [sWellness].[tProgramMaster] (
    [Id]                     INT            NOT NULL,
    [OrgId]                  SMALLINT       NOT NULL,
    [Title]                  NVARCHAR (100) NOT NULL,
    [ModeId]                 TINYINT        NOT NULL,
    [Description]            NVARCHAR (500) NULL,
    [FromDate]               DATE           NOT NULL,
    [ToDate]                 DATE           NOT NULL,
    [FromTime]               TIME (0)       NULL,
    [ToTime]                 TIME (0)       NULL,
    [IsSurveyRequired]       BIT            NOT NULL,
    [AssignSurveyId]         INT            NULL,
    [ProgramSubTypeId]       INT            NOT NULL,
    [IsRegistrationRequired] BIT            NOT NULL,
    [RegisterUptoDatetime]   DATETIME       NULL,
    [IsObsolete]             BIT            NOT NULL,
    [CreatedUserId]          BIGINT         NOT NULL,
    [CreatedDatetime]        DATETIME       NOT NULL,
    [UpdatedUserId]          BIGINT         NULL,
    [UpdatedDatetime]        DATETIME       NULL,
    CONSTRAINT [PK__tProgram__3214EC074CAFBA93] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramCustomField]...';


GO
CREATE TABLE [sWellness].[tProgramCustomField] (
    [Id]              INT             IDENTITY (1, 1) NOT NULL,
    [ProgramId]       INT             NOT NULL,
    [FieldTitle]      NVARCHAR (250)  NOT NULL,
    [FieldRemark]     NVARCHAR (2000) NULL,
    [FieldTypeId]     TINYINT         NOT NULL,
    [FieldList]       NVARCHAR (MAX)  NULL,
    [IsMandatory]     BIT             NOT NULL,
    [FieldOrderIndex] INT             NOT NULL,
    [CreatedUserId]   BIGINT          NOT NULL,
    [CreatedDatetime] DATETIME        NOT NULL,
    [UpdatedUserId]   BIGINT          NULL,
    [UpdatedDatetime] DATETIME        NULL,
    CONSTRAINT [PK__tProgram__3214EC0731340107] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramLocation]...';


GO
CREATE TABLE [sWellness].[tProgramLocation] (
    [AutoId]     INT IDENTITY (1, 1) NOT NULL,
    [ProgramId]  INT NOT NULL,
    [LocationId] INT NOT NULL,
    PRIMARY KEY CLUSTERED ([AutoId] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tWellnessRegistration]...';


GO
CREATE TABLE [sWellness].[tWellnessRegistration] (
    [Id]                       BIGINT         NOT NULL,
    [OrgId]                    SMALLINT       NOT NULL,
    [ParticipantSourceTypeId]  SMALLINT       NOT NULL,
    [ParticipantSourceId]      BIGINT         NOT NULL,
    [SetupId]                  INT            NOT NULL,
    [StatusId]                 INT            NOT NULL,
    [RegistrationDate]         DATE           NOT NULL,
    [DoctorEmployeeId]         BIGINT         NULL,
    [StoreLocationId]          INT            NOT NULL,
    [CauseId]                  INT            NULL,
    [Pulse]                    SMALLINT       NULL,
    [Temperature]              DECIMAL (5, 2) NULL,
    [BloodPressureSystolic]    INT            NULL,
    [BloodPressureDiastolic]   SMALLINT       NULL,
    [Respiration]              INT            NULL,
    [Height]                   INT            NULL,
    [BodyWeight]               DECIMAL (5, 2) NULL,
    [BMI]                      DECIMAL (5, 2) NULL,
    [ChestExpansion]           DECIMAL (5, 2) NULL,
    [AbdominalGirth]           DECIMAL (5, 2) NULL,
    [ElbowWidth]               DECIMAL (5, 2) NULL,
    [Waist]                    DECIMAL (5, 2) NULL,
    [Hip]                      DECIMAL (5, 2) NULL,
    [Remark]                   NVARCHAR (300) NULL,
    [ExaminationId]            BIGINT         NULL,
    [CreatedUserId]            BIGINT         NOT NULL,
    [CreatedDateTime]          DATETIME       NOT NULL,
    [UpdatedUserId]            BIGINT         NOT NULL,
    [UpdatedDateTime]          DATETIME       NOT NULL,
    [OtherName]                VARCHAR (200)  NULL,
    [RegistrationNumber]       VARCHAR (50)   NULL,
    [Age]                      INT            NULL,
    [Months]                   TINYINT        NULL,
    [GenderId]                 TINYINT        NULL,
    [ChestExpansionExhalation] DECIMAL (5, 2) NULL,
    [ChestExpansionInhalation] DECIMAL (5, 2) NULL,
    [TimeSlotId]               INT            NULL,
    [FromTime]                 NVARCHAR (100) NULL,
    [ToTime]                   NVARCHAR (100) NULL,
    [SPo2]                     DECIMAL (5, 2) NULL,
    [AppointmentId]            BIGINT         NULL,
    [CompliantRemark]          NVARCHAR (MAX) NULL,
    CONSTRAINT [PK_tWellnessRegistration] PRIMARY KEY CLUSTERED ([Id] ASC) WITH (FILLFACTOR = 85)
);


GO
PRINT N'Creating Table [sWellness].[tProgramCoach]...';


GO
CREATE TABLE [sWellness].[tProgramCoach] (
    [AutoId]           INT    IDENTITY (1, 1) NOT NULL,
    [ProgramId]        INT    NOT NULL,
    [DoctorEmployeeId] BIGINT NOT NULL,
    PRIMARY KEY CLUSTERED ([AutoId] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramAttendance]...';


GO
CREATE TABLE [sWellness].[tProgramAttendance] (
    [AutoId]               INT      IDENTITY (1, 1) NOT NULL,
    [ProgramId]            INT      NOT NULL,
    [ProgramParticipantId] BIGINT   NOT NULL,
    [AttendanceDate]       DATE     NOT NULL,
    [IsPresent]            BIT      NOT NULL,
    [CreatedUserId]        BIGINT   NOT NULL,
    [CreatedDateTime]      DATETIME NOT NULL,
    CONSTRAINT [PK_tProgramAttendance] PRIMARY KEY CLUSTERED ([AutoId] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramEvidence]...';


GO
CREATE TABLE [sWellness].[tProgramEvidence] (
    [Id]                  INT            IDENTITY (1, 1) NOT NULL,
    [ProgramId]           INT            NOT NULL,
    [FileName]            NVARCHAR (500) NOT NULL,
    [FilePath]            NVARCHAR (MAX) NOT NULL,
    [ConfigurationTypeId] TINYINT        NOT NULL,
    [IsObsolete]          BIT            NOT NULL,
    [CreatedUserId]       BIGINT         NOT NULL,
    [CreatedDateTime]     DATETIME       NOT NULL,
    [UpdatedUserId]       BIGINT         NULL,
    [UpdateDateTime]      DATETIME       NULL,
    CONSTRAINT [PK_tProgramEvidence] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramCustomFieldResponse]...';


GO
CREATE TABLE [sWellness].[tProgramCustomFieldResponse] (
    [Id]                      INT            IDENTITY (1, 1) NOT NULL,
    [ProgramParticipantId]    BIGINT         NOT NULL,
    [ProgramCustomFieldId]    INT            NOT NULL,
    [ProgramCustomFieldValue] NVARCHAR (MAX) NULL,
    [CreatedUserId]           BIGINT         NOT NULL,
    [CreatedDatetime]         DATETIME       NOT NULL,
    CONSTRAINT [PK_tProgramCustomFieldResponse] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramParameterTrack]...';


GO
CREATE TABLE [sWellness].[tProgramParameterTrack] (
    [Id]                    BIGINT         IDENTITY (1, 1) NOT NULL,
    [ProgramParticipantId]  BIGINT         NOT NULL,
    [ProgramParameterId]    INT            NOT NULL,
    [InputId]               TINYINT        NOT NULL,
    [ProgramParameterValue] NVARCHAR (500) NULL,
    [CreatedUserId]         BIGINT         NOT NULL,
    [CreatedDatetime]       DATETIME       NOT NULL,
    [UpdatedUserId]         BIGINT         NULL,
    [UpdatedDatetime]       DATETIME       NULL,
    CONSTRAINT [PK_tProgramParameterTrack] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramDocument]...';


GO
CREATE TABLE [sWellness].[tProgramDocument] (
    [Id]                  INT            IDENTITY (1, 1) NOT NULL,
    [ProgramId]           INT            NOT NULL,
    [FileName]            NVARCHAR (500) NOT NULL,
    [FilePath]            NVARCHAR (MAX) NOT NULL,
    [ConfigurationTypeId] TINYINT        NOT NULL,
    [IsObsolete]          BIT            NOT NULL,
    [CreatedUserId]       BIGINT         NOT NULL,
    [CreatedDateTime]     DATETIME       NOT NULL,
    [UpdatedUserId]       BIGINT         NULL,
    [UpdateDateTime]      DATETIME       NULL,
    CONSTRAINT [PK_tProgramDocument] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramParticipant]...';


GO
CREATE TABLE [sWellness].[tProgramParticipant] (
    [Id]                      BIGINT         IDENTITY (1, 1) NOT NULL,
    [ProgramId]               INT            NOT NULL,
    [RegisterTypeId]          TINYINT        NOT NULL,
    [ParticipantSourceTypeId] SMALLINT       NOT NULL,
    [ParticipantSourceId]     BIGINT         NOT NULL,
    [RegisterDateTime]        DATETIME       NOT NULL,
    [ParticipantCode]         NVARCHAR (50)  NULL,
    [ParticipantName]         NVARCHAR (250) NOT NULL,
    [ParticipantEmail]        NVARCHAR (150) NULL,
    [ParticipantMobileNo]     NVARCHAR (20)  NULL,
    [ParticipantBirthDate]    DATE           NULL,
    [ParticipantAge]          INT            NULL,
    [ParticipantGender]       TINYINT        NULL,
    [ParticipantLocationId]   INT            NULL,
    [ParticipantDepartmentId] INT            NULL,
    [CreatedUserId]           BIGINT         NOT NULL,
    [CreatedDateTime]         DATETIME       NOT NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramParameter]...';


GO
CREATE TABLE [sWellness].[tProgramParameter] (
    [AutoID]                BIGINT   IDENTITY (1, 1) NOT NULL,
    [OrgId]                 SMALLINT NOT NULL,
    [ProgramId]             BIGINT   NOT NULL,
    [ParameterTypeId]       TINYINT  NOT NULL,
    [ParameterSourceTypeId] SMALLINT NULL,
    [ParameterSourceId]     BIGINT   NOT NULL,
    [CreatedUserId]         BIGINT   NOT NULL,
    [CreatedDateTime]       DATETIME NOT NULL,
    [UpdatedUserId]         BIGINT   NULL,
    [UpdatedDateTime]       DATETIME NULL,
    [OrderIndex]            INT      NOT NULL,
    CONSTRAINT [PK_tProgramParameter] PRIMARY KEY CLUSTERED ([AutoID] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tProgramParticipantParameter]...';


GO
CREATE TABLE [sWellness].[tProgramParticipantParameter] (
    [AutoID]                  BIGINT         IDENTITY (1, 1) NOT NULL,
    [OrgId]                   SMALLINT       NOT NULL,
    [ProgramId]               BIGINT         NOT NULL,
    [ParameterSourceTypeId]   SMALLINT       NOT NULL,
    [ParameterSourceId]       BIGINT         NOT NULL,
    [StaticParameterSourceId] INT            NOT NULL,
    [ParticipantSourceTypeId] SMALLINT       NOT NULL,
    [ParticipantSourceId]     BIGINT         NOT NULL,
    [ParameterValue]          NVARCHAR (300) NOT NULL,
    [Remark]                  NVARCHAR (200) NOT NULL,
    [Diagnosis]               NVARCHAR (100) NOT NULL,
    [Recommendation]          NVARCHAR (100) NOT NULL,
    [IsAbnormal]              BIT            NOT NULL,
    [CreatedUserId]           BIGINT         NOT NULL,
    [CreatedDateTime]         DATETIME       NOT NULL,
    [UpdatedUserId]           BIGINT         NULL,
    [UpdatedDateTime]         DATETIME       NULL,
    CONSTRAINT [PK_tProgramParticipantParameter] PRIMARY KEY CLUSTERED ([AutoID] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tServiceFeedback]...';


GO
CREATE TABLE [sWellness].[tServiceFeedback] (
    [Id]                      BIGINT   IDENTITY (1, 1) NOT NULL,
    [FeedbackTypeId]          SMALLINT NULL,
    [DocumentSourceId]        BIGINT   NULL,
    [DocumentSourceTypeId]    SMALLINT NULL,
    [ParticipantSourceId]     BIGINT   NOT NULL,
    [ParticipantSourceTypeId] SMALLINT NOT NULL,
    [FeedbackForSourceTypeId] SMALLINT NULL,
    [FeedbackforSourceId]     BIGINT   NULL,
    [FeedbackDatetime]        DATETIME NULL,
    [CreatedDateTime]         DATETIME NOT NULL,
    [CreatedUserId]           BIGINT   NOT NULL,
    CONSTRAINT [PK__tSurveyF__3214EC0719441A13] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
PRINT N'Creating Table [sWellness].[tAppointment]...';


GO
CREATE TABLE [sWellness].[tAppointment] (
    [Id]                  BIGINT         NOT NULL,
    [AppointmentNumber]   NVARCHAR (20)  NOT NULL,
    [StatusId]            INT            NOT NULL,
    [DoctorEmployeeId]    BIGINT         NULL,
    [PatientSourceTypeId] SMALLINT       NOT NULL,
    [PatientSourceId]     BIGINT         NOT NULL,
    [AppointmentDate]     DATE           NOT NULL,
    [FromTime]            NVARCHAR (50)  NULL,
    [ToTime]              NVARCHAR (50)  NULL,
    [IsRegister]          BIT            NOT NULL,
    [IsObsolete]          BIT            NOT NULL,
    [CreatedUserId]       BIGINT         NULL,
    [CreatedDateTime]     DATETIME       NULL,
    [UpdatedUserId]       BIGINT         NULL,
    [UpdatedDateTime]     DATETIME       NULL,
    [OrgId]               SMALLINT       NOT NULL,
    [ReferSourceId]       BIGINT         NULL,
    [ReferSourceTypeId]   BIGINT         NULL,
    [StoreLocationId]     INT            NOT NULL,
    [SetupId]             INT            NOT NULL,
    [CauseId]             INT            NULL,
    [OtherName]           VARCHAR (200)  NULL,
    [FollowupRemark]      VARCHAR (200)  NULL,
    [Age]                 INT            NULL,
    [Months]              TINYINT        NULL,
    [GenderId]            TINYINT        NULL,
    [ExaminationId]       BIGINT         NULL,
    [TimeSlotId]          INT            NULL,
    [AppointmentType]     TINYINT        NULL,
    [EntryType]           TINYINT        NULL,
    [ApprovalStatusId]    INT            NULL,
    [MeetingId]           VARCHAR (50)   NULL,
    [MeetingPassword]     VARCHAR (50)   NULL,
    [IsCompleted]         BIT            NULL,
    [IsMeetingStarted]    BIT            NULL,
    [IsMeetingCreated]    BIT            NULL,
    [CancelReason]        NVARCHAR (MAX) NULL,
    [MeetingURL]          NVARCHAR (500) NULL,
    [CompliantRemark]     NVARCHAR (MAX) NULL,
    [AppointmentFlag]     VARCHAR (50)   NULL,
    CONSTRAINT [PK_tAppointment] PRIMARY KEY CLUSTERED ([Id] ASC) WITH (FILLFACTOR = 85)
);


GO
PRINT N'Creating Table [sAudit].[tArchiveAuditLogHistoryDocuments]...';


GO
CREATE TABLE [sAudit].[tArchiveAuditLogHistoryDocuments] (
    [Id]                  INT            IDENTITY (1, 1) NOT NULL,
    [FileName]            NVARCHAR (200) NULL,
    [ConfigurationTypeId] INT            NULL,
    [CreatedDateTime]     DATETIME       NOT NULL,
    [OrgId]               INT            NOT NULL
);


GO
PRINT N'Creating Table [sTm].[tShiftCommunicationLog]...';


GO
CREATE TABLE [sTm].[tShiftCommunicationLog] (
    [Id]                INT             NOT NULL,
    [EmployeeId]        BIGINT          NOT NULL,
    [ShiftRoasterId]    INT             NOT NULL,
    [CommunicationDate] DATE            NOT NULL,
    [CommunicationType] SMALLINT        NOT NULL,
    [Mode]              SMALLINT        NOT NULL,
    [Duration]          INT             NOT NULL,
    [Remarks]           NVARCHAR (1000) NULL,
    [IsObsolete]        BIT             NOT NULL,
    [OrgId]             INT             NOT NULL,
    [CreatedUserId]     BIGINT          NOT NULL,
    [CreatedDateTime]   DATETIME        NOT NULL,
    [UpdatedUserId]     BIGINT          NULL,
    [UpdatedDateTime]   DATETIME        NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
PRINT N'Creating Default Constraint [sWellness].[DF__tProgramM__IsReg__6297C7B1]...';


GO
ALTER TABLE [sWellness].[tProgramMaster]
    ADD CONSTRAINT [DF__tProgramM__IsReg__6297C7B1] DEFAULT ((0)) FOR [IsRegistrationRequired];


GO
PRINT N'Creating Default Constraint [sWellness].[DF__tProgramM__IsSur__61A3A378]...';


GO
ALTER TABLE [sWellness].[tProgramMaster]
    ADD CONSTRAINT [DF__tProgramM__IsSur__61A3A378] DEFAULT ((0)) FOR [IsSurveyRequired];


GO
PRINT N'Creating Default Constraint [sWellness].[DF__tProgramM__IsObs__638BEBEA]...';


GO
ALTER TABLE [sWellness].[tProgramMaster]
    ADD CONSTRAINT [DF__tProgramM__IsObs__638BEBEA] DEFAULT ((0)) FOR [IsObsolete];


GO
PRINT N'Creating Default Constraint [sWellness].[DF__tProgramC__IsMan__675C7CCE]...';


GO
ALTER TABLE [sWellness].[tProgramCustomField]
    ADD CONSTRAINT [DF__tProgramC__IsMan__675C7CCE] DEFAULT ((0)) FOR [IsMandatory];


GO
PRINT N'Creating Default Constraint unnamed constraint on [sWellness].[tProgramAttendance]...';


GO
ALTER TABLE [sWellness].[tProgramAttendance]
    ADD DEFAULT (getutcdate()) FOR [CreatedDateTime];


GO
PRINT N'Creating Default Constraint unnamed constraint on [sWellness].[tProgramEvidence]...';


GO
ALTER TABLE [sWellness].[tProgramEvidence]
    ADD DEFAULT (getutcdate()) FOR [CreatedDateTime];


GO
PRINT N'Creating Default Constraint unnamed constraint on [sWellness].[tProgramEvidence]...';


GO
ALTER TABLE [sWellness].[tProgramEvidence]
    ADD DEFAULT ((0)) FOR [IsObsolete];


GO
PRINT N'Creating Default Constraint unnamed constraint on [sWellness].[tProgramCustomFieldResponse]...';


GO
ALTER TABLE [sWellness].[tProgramCustomFieldResponse]
    ADD DEFAULT (getutcdate()) FOR [CreatedDatetime];


GO
PRINT N'Creating Default Constraint unnamed constraint on [sWellness].[tProgramParameterTrack]...';


GO
ALTER TABLE [sWellness].[tProgramParameterTrack]
    ADD DEFAULT (getutcdate()) FOR [CreatedDatetime];


GO
PRINT N'Creating Default Constraint unnamed constraint on [sWellness].[tProgramDocument]...';


GO
ALTER TABLE [sWellness].[tProgramDocument]
    ADD DEFAULT ((0)) FOR [IsObsolete];


GO
PRINT N'Creating Default Constraint unnamed constraint on [sWellness].[tProgramDocument]...';


GO
ALTER TABLE [sWellness].[tProgramDocument]
    ADD DEFAULT (getutcdate()) FOR [CreatedDateTime];


GO
PRINT N'Creating Default Constraint [sWellness].[DF_tAppointment_CauseId]...';


GO
ALTER TABLE [sWellness].[tAppointment]
    ADD CONSTRAINT [DF_tAppointment_CauseId] DEFAULT ((0)) FOR [CauseId];


GO
PRINT N'Creating Default Constraint [sPermit].[DF__tPermitRe__SiteI__67850352]...';


GO
ALTER TABLE [sPermit].[tPermitRequestMasterNew]
    ADD CONSTRAINT [DF__tPermitRe__SiteI__67850352] DEFAULT ((0)) FOR [SiteId];