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

Schema::hasTable no longer returns true for a view #49227

Closed
tobya opened this issue Dec 3, 2023 · 1 comment · Fixed by #49231
Closed

Schema::hasTable no longer returns true for a view #49227

tobya opened this issue Dec 3, 2023 · 1 comment · Fixed by #49231
Labels

Comments

@tobya
Copy link

tobya commented Dec 3, 2023

Laravel Version

10.34.0

PHP Version

8.2

Database Driver & Version

MSSQL SERVER

Description

As part of 10.34 some change has been made that changes the behaviour of the

Schema::hasTable

method. In 10.33 and below this static function would return true for a view, allowing a view to be checked for existance before doing some code.

This behaviour has changed and now returns false for any view whether it exists or not.

I cant find the code that has made this change, but it may be related to #49020

There does not appear to be a replacement hasView method.

Mysql database seems to have always returned false.

Steps To Reproduce

  • Create a view on a MSSQLSERVER database
  • call Schema::hasTable('nameofview') and it will return false.

Downgrade to 10.33

  • call Schema::hasTable('nameofview') and it will return true.
@taylorotwell
Copy link
Member

Schema::hasView coming in next patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants