8000 [PM-20576] OrganizationReport - Queries and Command by voommen-livefront · Pull Request #5983 · bitwarden/server · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[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

Merged
merged 56 commits into from
Jun 24, 2025

Conversation

voommen-livefront
Copy link
Collaborator

🎟️ 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

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 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

prograhamming and others added 30 commits May 16, 2025 10:50
[dbo].[OrganizationReport];
GO

CREATE PROCEDURE [dbo].[OrganizationReport_Create]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing create or alter

Copy link
Collaborator Author

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);

Copy link
Contributor

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

Copy link
Collaborator Author

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.

prograhamming
prograhamming previously approved these changes Jun 23, 2025
Copy link

@voommen-livefront voommen-livefront merged commit 86a4ce5 into main Jun 24, 2025
41 checks passed
@voommen-livefront voommen-livefront deleted the dirt/pm-20576/report-store-query-commands branch June 24, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0