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

[6.x] Add `dropAllViews` functionality to the SQL Server builder #30222

Merged
merged 3 commits into from Oct 15, 2019

Conversation

@mikeu
Copy link
Contributor

mikeu commented Oct 8, 2019

Currently, trying to drop all views on a SQL Server database (e.g. with protected $dropViews = true; in your test case) throws a LogicException because the SQL Server builder does not override dropAllViews().

This PR adds that functionality, overriding dropAllViews() in Illuminate\Database\Schema\SqlServerBuilder.

@mikeu mikeu changed the title Add `dropAllViews` functionality to the SQL Server builder [6.x] Add `dropAllViews` functionality to the SQL Server builder Oct 8, 2019
@taylorotwell

This comment has been minimized.

Copy link
Member

taylorotwell commented Oct 9, 2019

Can someone else that uses SQL Server confirm this?

@mikeu

This comment has been minimized.

Copy link
Contributor Author

mikeu commented Oct 11, 2019

@taylorotwell I'm definitely all for having someone else confirm this, but wondering if there's anything I could do to make that easier/faster. A SQL fiddle showing the generated command running against SQL Server for example, or a sample repo with migrations that generate views, and a test that has $dropViews = true, maybe. Or is it just a matter of waiting for someone appropriate to see this at this point?

@taylorotwell

This comment has been minimized.

Copy link
Member

taylorotwell commented Oct 14, 2019

A SQL fiddle would be nice if that is possible.

@taylorotwell taylorotwell merged commit 75d8066 into laravel:6.x Oct 15, 2019
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/styleci/pr The analysis has passed
Details
@mikeu

This comment has been minimized.

Copy link
Contributor Author

mikeu commented Oct 15, 2019

Hopefully better late than never, here's a quick fiddle to demonstrate dropping an existing view with the generated command that's now been merged:

http://sqlfiddle.com/#!18/9a983/8

(With the final failure of course being expected, because the view has successfully been dropped.)

@mikeu mikeu deleted the mikeu:sql-server-drop-all-views branch Oct 15, 2019
kayrunm added a commit to kayrunm/framework that referenced this pull request Oct 16, 2019
…avel#30222)

* Add function to generate drop-all-views command

* Add `dropAllViews` function to SQL Server Builder

* Update SqlServerGrammar.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.