mirror of
https://github.com/bitwarden/server.git
synced 2025-04-04 20:50:21 -05:00
Use check
This commit is contained in:
parent
6227ff6534
commit
d6c7bf0f28
@ -1,6 +1,12 @@
|
||||
-- Configure FK to cascade on delete
|
||||
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;
|
||||
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] ADD CONSTRAINT [FK_OrganizationIntegrationConfiguration_OrganizationIntegration] FOREIGN KEY ([OrganizationIntegrationId]) REFERENCES [dbo].[OrganizationIntegration] ([Id]) ON DELETE CASCADE;
|
||||
END
|
||||
GO
|
||||
|
||||
CREATE OR ALTER PROCEDURE [dbo].[OrganizationIntegration_Create]
|
||||
|
Loading…
x
Reference in New Issue
Block a user