mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
Use check
This commit is contained in:
parent
6227ff6534
commit
d6c7bf0f28
@ -1,6 +1,12 @@
|
|||||||
-- Configure FK to cascade on delete
|
-- Configure FK to cascade on delete
|
||||||
|
IF EXISTS(SELECT *
|
||||||
|
FROM information_schema.table_constraints
|
||||||
|
WHERE table_name='OrganizationIntegrationConfiguration'
|
||||||
|
AND constraint_name='FK_OrganizationIntegrationConfiguration_OrganizationIntegration')
|
||||||
|
BEGIN
|
||||||
ALTER TABLE [dbo].[OrganizationIntegrationConfiguration] DROP FK_OrganizationIntegrationConfiguration_OrganizationIntegration;
|
ALTER TABLE [dbo].[OrganizationIntegrationConfiguration] DROP FK_OrganizationIntegrationConfiguration_OrganizationIntegration;
|
||||||
ALTER TABLE [dbo].[OrganizationIntegrationConfiguration] ADD CONSTRAINT [FK_OrganizationIntegrationConfiguration_OrganizationIntegration] FOREIGN KEY ([OrganizationIntegrationId]) REFERENCES [dbo].[OrganizationIntegration] ([Id]) ON DELETE CASCADE;
|
ALTER TABLE [dbo].[OrganizationIntegrationConfiguration] ADD CONSTRAINT [FK_OrganizationIntegrationConfiguration_OrganizationIntegration] FOREIGN KEY ([OrganizationIntegrationId]) REFERENCES [dbo].[OrganizationIntegration] ([Id]) ON DELETE CASCADE;
|
||||||
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
CREATE OR ALTER PROCEDURE [dbo].[OrganizationIntegration_Create]
|
CREATE OR ALTER PROCEDURE [dbo].[OrganizationIntegration_Create]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user