-- This is completely nuts, there has to be a better way to handle database change scripts -- and methodology. Someone has to own this part. SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[New_Notifications]( [_key] [bigint] IDENTITY(1,1) NOT NULL, [Processed] [bit] NOT NULL, [ObjectId] [bigint] NOT NULL, [ObjectType] [int] NOT NULL, [Action] [int] NOT NULL, [IssuerId] [int] NOT NULL, [IssuerType] [int] NOT NULL, [RecipientId] [int] NOT NULL, [RecipientType] [int] NOT NULL, [CreatedOn] [datetime] NOT NULL, [ExpiredBy] [datetime] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[NotificationInstance] Script Date: 8/31/2015 2:50:11 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[NotificationInstance]( [Id] [int] IDENTITY(1,1) NOT NULL, [UserId] [int] NOT NULL, [TargetText] [varchar](256) NOT NULL, [DeliveredToUser] [bit] NOT NULL, [ReadByUser] [bit] NOT NULL, [CreatedOn] [datetime] NOT NULL CONSTRAINT [DF_NotificationInstance_CreatedOn] DEFAULT (getdate()), [TemplateUsed] [int] NULL ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[NotificationTemplate] Script Date: 8/31/2015 2:50:55 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING OFF GO CREATE TABLE [dbo].[NotificationTemplate]( [Id] [int] IDENTITY(1,1) NOT NULL, [ObjectType] [int] NOT NULL, [Property] [int] NOT NULL, [Action] [int] NOT NULL, [HasObjectId] [bit] NOT NULL, [MessageTemplate] [varchar](256) NOT NULL, [ClubbablePlaceHolder] [int] NOT NULL CONSTRAINT [DF_NotificationTemplate_ClubbablePlaceHolder] DEFAULT ((-1)), [ClubOnPlaceHolder] [int] NOT NULL CONSTRAINT [DF_NotificationTemplate_ClubOnPlaceHolder] DEFAULT ((-1)), [ClubbedMessageTemplate] [varchar](256) NULL ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO --Add this row --Id ObjectType Property Action HasObjectId MessageTemplate ClubbablePlaceHolder ClubOnPlaceHolder ClubbedMessageTemplate --20 7 0 1 0 {0} has commented on {1}'s snapshot 0 -1 NULL insert into dbo.NotificationTemplate select nt.EntityType as ObjectType, nt.Property as Property, nt.[Action] as [Action], nt.HasEntityId as HasObjectId, nt.MessageTemplate, nt.ClubbablePlaceHolder, nt.ClubOnPlaceHolder, nt.ClubbedMessageTemplate from HL_MONF_Data.dbo.OLD_NotificationTemplate nt -- For adding drill thru column to VisualUnit Table BEGIN TRANSACTION SET QUOTED_IDENTIFIER ON SET ARITHABORT ON SET NUMERIC_ROUNDABORT OFF SET CONCAT_NULL_YIELDS_NULL ON SET ANSI_NULLS ON SET ANSI_PADDING ON SET ANSI_WARNINGS ON COMMIT BEGIN TRANSACTION GO ALTER TABLE dbo.VisualUnit ADD AllowDrillThru varchar(5) NOT NULL CONSTRAINT DF_VisualUnit_AllowDrillThru DEFAULT 'Y' GO ALTER TABLE dbo.VisualUnit SET (LOCK_ESCALATION = TABLE) GO COMMIT