Merge branch 'worktree-agent-a7e4ca4e5668d81b3' into arch-review-remediation

This commit is contained in:
Joseph Doherty
2026-08-14 20:14:13 -04:00
8 changed files with 2265 additions and 3 deletions
@@ -0,0 +1,35 @@
BEGIN TRANSACTION;
IF NOT EXISTS (
SELECT * FROM [__EFMigrationsHistory]
WHERE [MigrationId] = N'20260814235335_AddAuditLogAndNotificationCoveringIndexes'
)
BEGIN
EXEC(N'CREATE INDEX [IX_Notifications_Delivered] ON [Notifications] ([DeliveredAt]) WHERE [Status] = ''Delivered''');
END;
IF NOT EXISTS (
SELECT * FROM [__EFMigrationsHistory]
WHERE [MigrationId] = N'20260814235335_AddAuditLogAndNotificationCoveringIndexes'
)
BEGIN
DROP INDEX IX_AuditLog_OccurredAtUtc ON dbo.AuditLog;
CREATE NONCLUSTERED INDEX IX_AuditLog_OccurredAtUtc
ON dbo.AuditLog (OccurredAtUtc DESC)
INCLUDE (Status)
ON ps_AuditLog_Month(OccurredAtUtc);
END;
IF NOT EXISTS (
SELECT * FROM [__EFMigrationsHistory]
WHERE [MigrationId] = N'20260814235335_AddAuditLogAndNotificationCoveringIndexes'
)
BEGIN
INSERT INTO [__EFMigrationsHistory] ([MigrationId], [ProductVersion])
VALUES (N'20260814235335_AddAuditLogAndNotificationCoveringIndexes', N'10.0.7');
END;
COMMIT;
GO