IF NOT EXISTS (SELECT * FROM sysobjects WHERE name = 'RKaraNotify')
BEGIN
    CREATE TABLE [dbo].[RKaraNotify]
    (
        [Id] [UNIQUEIDENTIFIER] NOT NULL
            DEFAULT (NEWID()),
        [RKaraNotifyId] [INT] NULL,
        [Type] [TINYINT] NULL,
        [Status] [TINYINT] NULL
            DEFAULT ((0)),
        [Title] [NVARCHAR](MAX) NULL,
        [Text] [NVARCHAR](MAX) NULL,
        [CreatedOn] [SMALLDATETIME] NULL
            DEFAULT (GETDATE()),
        [CreatedBy] [SMALLINT] NULL,
        [ReceivedOn] [SMALLDATETIME] NULL
            DEFAULT (GETDATE()),
        [ParentId] [UNIQUEIDENTIFIER] NULL,
        CONSTRAINT [PK_RKaraNotify]
            PRIMARY KEY CLUSTERED ([Id] ASC) ON [PRIMARY]
    );
END;