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 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
Copy link
Member

Can someone else that uses SQL Server confirm this?

@mikeu
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
Copy link
Member

A SQL fiddle would be nice if that is possible.

@taylorotwell taylorotwell merged commit 75d8066 into laravel:6.x Oct 15, 2019
@mikeu
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 sql-server-drop-all-views branch October 15, 2019 17:06
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.

2 participants