Skip to content

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

@tobya

Description

@tobya

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions