-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[PM-20576] OrganizationReport - Queries and Command #5983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PM-20576] OrganizationReport - Queries and Command #5983
Conversation
[dbo].[OrganizationReport]; | ||
GO | ||
|
||
CREATE PROCEDURE [dbo].[OrganizationReport_Create] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing create or alter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix this in the previous PR #5839
Since this PR depended on that - I have branched out of that PR.
CREATE NONCLUSTERED INDEX [IX_OrganizationReport_OrganizationId] ON [dbo].[OrganizationReport]([OrganizationId] ASC); | ||
|
||
CREATE NONCLUSTERED INDEX [IX_OrganizationReport_OrganizationId_Date] ON [dbo].[OrganizationReport]([OrganizationId] ASC, [Date] DESC); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will want to check for existence
IF NOT EXISTS (
SELECT 1
FROM sys.indexes
WHERE name = 'IX_OrganizationReport_OrganizationId'
AND object_id = OBJECT_ID('dbo.OrganizationReport')
)
BEGIN
CREATE NONCLUSTERED INDEX [IX_OrganizationReport_OrganizationId]
ON [dbo].[OrganizationReport]([OrganizationId] ASC);
END
GO
IF NOT EXISTS (
SELECT 1
FROM sys.indexes
WHERE name = 'IX_OrganizationReport_OrganizationId_Date'
AND object_id = OBJECT_ID('dbo.OrganizationReport')
)
BEGIN
CREATE NONCLUSTERED INDEX [IX_OrganizationReport_OrganizationId_Date]
ON [dbo].[OrganizationReport]([OrganizationId] ASC, [Date] DESC);
END
GO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured that if the table is being created, the indexes shouldn't already exist. Therefore, I didn't do this check.
… into dirt/pm-20576/report-store-query-commands
|
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-20576
📔 Objective
An earlier PR created a table called
OrganizationReport
.This tasks involves creating the commands and queries to Add, Get, Drop records to that table - with unit tests.
📸 Screenshots
No screenshots at this moment.
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes