-
-
Notifications
You must be signed in to change notification settings - Fork 785
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
New commands: New-DbaDbFileGroup, Set-DbaDbFileGroup, and Remove-DbaDbFileGroup #7306
New commands: New-DbaDbFileGroup, Set-DbaDbFileGroup, and Remove-DbaDbFileGroup #7306
Conversation
- Minor fix for Disable-DbaFilestream
Thank you, Adam! Will hopefully take a look this weekend. |
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.
This is great work - few ideas\comments for discussion. Thanks for your contributions!
.PARAMETER Default | ||
Specifies if the filegroup should be the default. Only one filegroup in a database can be specified as the default. | ||
|
||
.PARAMETER ReadOnly |
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.
Is there or should there be a way to set to turn ReadOnly back off?
functions/Set-DbaDbFileGroup.ps1
Outdated
Specifies the filegroup should be readonly. | ||
|
||
.PARAMETER AutoGrowAllFiles | ||
Specifies the filegroup should auto grow all files if one file has met the threshold to autogrow. |
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.
Same question - how do you turn this off? Do we need that?
functions/Set-DbaDbFileGroup.ps1
Outdated
Specifies the filegroup should auto grow all files if one file has met the threshold to autogrow. | ||
|
||
.PARAMETER InputObject | ||
Allows piping from Get-DbaDatabase. |
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'm wondering if this should be piping from Get-DbaDbFileGroup instead of Get-DbaDatabase... thoughts? discussion?
functions/Remove-DbaDbFileGroup.ps1
Outdated
[DbaInstanceParameter[]]$SqlInstance, | ||
[PSCredential]$SqlCredential, | ||
[string[]]$Database, | ||
[string]$FileGroupName, |
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.
Wondering if FileGroup could accept multiple filegroups to be deleted at once?
functions/New-DbaDbFileGroup.ps1
Outdated
.PARAMETER Database | ||
The target database(s). | ||
|
||
.PARAMETER FileGroupName |
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.
Could you rename this to just FileGroup for all three functions please? We tend to drop the name
.
Thanks @jpomfret, much appreciated. I'll look into those items. |
@jpomfret, thanks again for the feedback. I've incorporated all of the suggestions:
|
functions/Set-DbaDbFileGroup.ps1
Outdated
[switch]$ReadOnly, | ||
[switch]$ReadWrite, |
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 think it might be better to handle these as a single param instead of two switches... this currently doesn't fail and seems to set it to ReadWrite.
Set-DbaDbFileGroup -SqlInstance mssql1 -Database DatabaseAdmin -FileGroup test2New -ReadWrite -ReadOnly
You could leave it as a switch $ReadOnly
and people can use $ReadOnly:$False
to it back to ReadWrite.. or perhaps make it a string that accepts Enabled or Disabled as values?
Tagging @potatoqualitee and @wsmelton - do you have preferences or do we have a standard we should follow here?
functions/Set-DbaDbFileGroup.ps1
Outdated
[switch]$ReadOnly, | ||
[switch]$ReadWrite, | ||
[switch]$AutoGrowAllFiles, | ||
[switch]$AutoGrowSingleFile, |
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.
Same for these two, perhaps $AutoGrowAllFiles
with Enabled\Disabled options?
This needs to be closed and created as PR for each command. |
It is easier to review single command than trying to review multiple into one. Believe this has been mentioned before but may be wrong. |
@wsmelton - happy for that to happen going forward, but we already have a lot of comments\discussion on this PR. Having them in one seemed to make sense for me to pull it down to my machine to test as well. Do you have a preference on how ReadOnly and AutoGrowAllFiles should be handled? |
Apologies on the close\reopen - miss press on the app |
These three related commands seem reasonable to me as one PR. I'd prefer making it more convenient for contributors when possible, and allow multi files PRs unless it doesn't make sense for an unforeseen reason 🙇 |
Makes sense to me @potatoqualitee - thanks. @lancasteradam - as for the param decisions... I think I'm leaning towards the best option being to make them both switches that when used set the property, and to unset it |
@jpomfret, I agree, that sounds good. I'll make those changes. |
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.
looks good - thanks!
unrelated test failures |
Type of Change
Purpose
Approach
Basic commands for filegroup create, update, remove. All feedback is welcome.
Commands to test
See the command examples and the integration tests.