|
|
@ -77,9 +77,10 @@ ALTER TABLE [dbo].[contactgroupmembers] ADD CONSTRAINT [FK_contactgroupmembers_c
|
|
|
|
ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
GO
|
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
ALTER TABLE [dbo].[contactgroupmembers] ADD CONSTRAINT [FK_contactgroupmembers_contact_id]
|
|
|
|
CREATE TRIGGER [contact_delete_member] ON [dbo].[contacts]
|
|
|
|
FOREIGN KEY ([contact_id]) REFERENCES [dbo].[contacts] ([contact_id])
|
|
|
|
AFTER DELETE AS
|
|
|
|
ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
DELETE FROM [dbo].[contactgroupmembers]
|
|
|
|
|
|
|
|
WHERE [contact_id] IN (SELECT [contact_id] FROM deleted)
|
|
|
|
GO
|
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
ALTER TABLE [dbo].[contactgroups] ADD CONSTRAINT [FK_contactgroups_user_id]
|
|
|
|
ALTER TABLE [dbo].[contactgroups] ADD CONSTRAINT [FK_contactgroups_user_id]
|
|
|
|