Skip to content

[5.7] Sqlite & dropForeign #25475

Closed
@okdewit

Description

@okdewit
  • Laravel Version: 5.7.1
  • PHP Version: 7.2
  • Database Driver & Version: MySQL 8, Sqlite

Description:

When using Laravel, using in-memory Sqlite for tests while using MySQL/Postgres for dev/prod requests is quite common.

Laravel 5.7 contains an undocumented change which throws an exception when trying to drop foreign keys in Sqlite: #24052

When a testsuite runs migrations, it produces the message:
SQLite doesn't support dropping foreign keys (you would need to re-create the table).

While this is technically correct, this strict behavior also removes the possibility to silently ignore foreign keys in Sqlite and use the same migrations with multiple drivers.

Could the checks in #24052 be reverted, or be made configurable?

If not, I think it should at least be added to the 5.7 upgrade docs to set expectations. Rewriting hundreds of migrations is quite impactful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions