 
 GO
 
-ALTER TABLE [dbo].[EventNotification] CHECK CONSTRAINT [FK_EventNotification_Subscription]
-
-GO
-
-/****** Object:  ForeignKey [FK_Subscription_SubscriptionType]    Script Date: 02/13/2011 17:59:04 ******/
-
-IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_Subscription_SubscriptionType]') AND parent_object_id = OBJECT_ID(N'[dbo].[Subscription]'))
-
-ALTER TABLE [dbo].[Subscription]  WITH CHECK ADD  CONSTRAINT [FK_Subscription_SubscriptionType] FOREIGN KEY([SubscriptionTypeId])
-
-REFERENCES [dbo].[SubscriptionType] ([SubscriptionTypeId])
-
-GO
-
-ALTER TABLE [dbo].[Subscription] CHECK CONSTRAINT [FK_Subscription_SubscriptionType]
-
-GO
-
-/****** Object:  ForeignKey [FK_SubscriptionPerson_Subscription]    Script Date: 02/13/2011 17:59:04 ******/
-
-IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_SubscriptionPerson_Subscription]') AND parent_object_id = OBJECT_ID(N'[dbo].[SubscriptionPerson]'))
-
-ALTER TABLE [dbo].[SubscriptionPerson]  WITH CHECK ADD  CONSTRAINT [FK_SubscriptionPerson_Subscription] FOREIGN KEY([SubscriptionId])
-
-REFERENCES [dbo].[Subscription] ([SubscriptionId])
-
-ON UPDATE CASCADE
-
-ON DELETE CASCADE
-
-GO
-
 ALTER TABLE [dbo].[SubscriptionPerson] CHECK CONSTRAINT [FK_SubscriptionPerson_Subscription]
 
 GO


GO

/****** Object:  Default [DF_BirthdateSubscription_SubscriptionId]    Script Date: 02/13/2011 17:59:04 ******/

IF  EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_BirthdateSubscription_SubscriptionId]') AND parent_object_id = OBJECT_ID(N'[dbo].[BirthdateSubscription]'))

Begin

ALTER TABLE [dbo].[BirthdateSubscription] DROP CONSTRAINT [DF_BirthdateSubscription_SubscriptionId]



End

GO

/****** Object:  Default [DF_BirthdateSubscription_OffsetDays]    Script Date: 02/13/2011 17:59:04 ******/

IF  EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_BirthdateSubscription_OffsetDays]') AND parent_object_id = OBJECT_ID(N'[dbo].[BirthdateSubscription]'))

Begin

ALTER TABLE [dbo].[BirthdateSubscription] DROP CONSTRAINT [DF_BirthdateSubscription_OffsetDays]



End

GO

/****** Object:  Default [DF_EventNotification_EventNotificationId]    Script Date: 02/13/2011 17:59:04 ******/

IF  EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_EventNotification_EventNotificationId]') AND parent_object_id = OBJECT_ID(N'[dbo].[EventNotification]'))


GO

/****** Object:  Table [dbo].[SubscriptionPerson]    Script Date: 02/13/2011 17:59:04 ******/

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SubscriptionPerson]') AND type in (N'U'))
