- Fix error in MSSQL DDL scripts (#1487112): use trigger instead of foreign key constraint

release-0.6
alecpl 14 years ago
parent 3e54812afa
commit 8710133250

@ -71,6 +71,7 @@ CHANGELOG Roundcube Webmail
- jQuery 1.4.4
- Fix handling of HTML entity strings in plain text messages
- Fix focused elements aren't unfocused when clicking on the list (#1487123)
- Fix error in MSSQL DDL scripts (#1487112)
RELEASE 0.4.2
-------------

@ -291,8 +291,11 @@ ALTER TABLE [dbo].[contactgroupmembers] ADD CONSTRAINT [FK_contactgroupmembers_c
ON DELETE CASCADE ON UPDATE CASCADE
GO
ALTER TABLE [dbo].[contactgroupmembers] ADD CONSTRAINT [FK_contactgroupmembers_contact_id]
FOREIGN KEY ([contact_id]) REFERENCES [dbo].[contacts] ([contact_id])
ON DELETE CASCADE ON UPDATE CASCADE
-- Use trigger instead of foreign key (#1487112)
-- "Introducing FOREIGN KEY constraint ... may cause cycles or multiple cascade paths."
CREATE TRIGGER [contact_delete_member] ON [dbo].[contacts]
AFTER DELETE AS
DELETE FROM [dbo].[contactgroupmembers]
WHERE [contact_id] IN (SELECT [contact_id] FROM deleted)
GO

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

Loading…
Cancel
Save