Skip to content
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

Bug Fix #9068. New-DbaDbUser #9078

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

sqlarticles
Copy link
Contributor

Please read -- recent changes to our repo

On November 10, 2022, we removed some bloat from our repository (for the second and final time). This change requires that all contributors reclone or refork their repo.

PRs from repos that have not been recently reforked or recloned will be closed and @potatoqualitee will cherry-pick your commits and open a new PR with your changes.

  • [x ] Please confirm you have the smaller repo (85MB .git directory vs 275MB or 110MB or 185MB .git directory)

Type of Change

  • [x ] Bug fix (non-breaking change, fixes # )
  • New feature (non-breaking change, adds functionality, fixes # )
  • Breaking change (affects multiple commands or functionality, fixes # )
  • Ran manual Pester test and has passed (.\tests\manual.pester.ps1)
  • Adding code coverage to existing functionality
  • [x ] Pester test is included
  • If new file reference added for test, has is been added to github.com/dataplat/appveyor-lab ?
  • Unit test is included
  • Documentation
  • Build system

Purpose

Approach

Bug fix #9068

New-DbaDbUser function failed to create the user in all the user databases when Database parameter is not provided. Changes are made to fix this, when the Database parameter is not provided then the user will be created in all the user databases.

Commands to test

New-DbaDbUser -SqlInstance Server1 -Login User1

Screenshots

Learning

@wsmelton
Copy link
Member

wsmelton commented Sep 8, 2023

Test is failing for adding users to multiple databases:

image

@sqlarticles
Copy link
Contributor Author

Thanks, @wsmelton. My office network blocks downloading anything from GitHub. Couldn't check this when I'm in office.

I added a new test to cover this scenario. Looks like the test server has more database than the ones created for this testing. I will modify the test so that it matches with the total number of user databases in the test server.

@sqlarticles sqlarticles marked this pull request as ready for review September 13, 2023 23:03
@sqlarticles
Copy link
Contributor Author

@wsmelton Fixed the tests, its looking good now. Can you please review?

@sqlarticles
Copy link
Contributor Author

Can this PR get reviewed please?

@potatoqualitee
Copy link
Member

yes, our apologies, @sqlarticles. We had code signing issues that preventing merging/releasing. Tests pass, your code looks good and we very much appreciate the PR 👍🏼 💯

@potatoqualitee potatoqualitee merged commit 81ebba2 into dataplat:development Sep 21, 2023
2 checks passed
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.

New-dbaDBUser does not add user to databases if the -Database parameter is ommitted
3 participants