Skip to content

Commit

Permalink
Adding the RecordDefaultTTL and RecordMinimumTTL property to existing…
Browse files Browse the repository at this point in the history
… DNS providers
  • Loading branch information
FuseCP-TRobinson committed Dec 10, 2024
1 parent 6dd95b5 commit 95eb20a
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion SolidCP/Database/update_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20367,7 +20367,7 @@ END
GO

-- Add defaultdomainhostname property to existing SM providers
IF NOT EXISTS (Select * from [ServiceProperties] INNER JOIN Services ON ServiceProperties.ServiceID=Services.ServiceID Where Services.ProviderID = 67 AND ServiceProperties.PropertyName = N'defaultdomainhostname')
IF NOT EXISTS (Select * from [ServiceProperties] INNER JOIN Services ON ServiceProperties.ServiceID=Services.ServiceID Where Services.ProviderID IN (11, 14, 29, 60, 64, 65, 65, 66, 67) AND ServiceProperties.PropertyName = N'defaultdomainhostname')
BEGIN
DECLARE service_cursor CURSOR FOR SELECT ServiceId FROM Services WHERE ProviderID IN (11, 14, 29, 60, 64, 65, 65, 66, 67)
DECLARE @ServiceID INT
Expand All @@ -20382,6 +20382,28 @@ BEGIN
FETCH NEXT FROM service_cursor INTO @ServiceID
END

CLOSE service_cursor
DEALLOCATE service_cursor
END
GO

-- Add RecordDefaultTTL and RecordMinimumTTL property to existing DNS providers
IF NOT EXISTS (Select * from [ServiceProperties] INNER JOIN Services ON ServiceProperties.ServiceID=Services.ServiceID Where Services.ProviderID IN (7, 9, 24, 28, 55, 56, 410, 1703, 1901, 1902, 1903) AND ServiceProperties.PropertyName = N'RecordMinimumTTL')
BEGIN
DECLARE service_cursor CURSOR FOR SELECT ServiceId FROM Services WHERE ProviderID IN (7, 9, 24, 28, 55, 56, 410, 1703, 1901, 1902, 1903)
DECLARE @ServiceID INT
OPEN service_cursor
FETCH NEXT FROM service_cursor INTO @ServiceID
WHILE @@FETCH_STATUS = 0
BEGIN
BEGIN
INSERT [dbo].[ServiceProperties] ([ServiceID], [PropertyName], [PropertyValue]) VALUES (@ServiceID, N'RecordMinimumTTL', N'3600')
INSERT [dbo].[ServiceProperties] ([ServiceID], [PropertyName], [PropertyValue]) VALUES (@ServiceID, N'RecordDefaultTTL', N'86400')
END

FETCH NEXT FROM service_cursor INTO @ServiceID
END

CLOSE service_cursor
DEALLOCATE service_cursor
END
Expand Down

0 comments on commit 95eb20a

Please sign in to comment.