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

SQLiteGrammar compileDropColumn() ignores connection table prefix #22741

Closed
tomlankhorst opened this issue Jan 11, 2018 · 0 comments
Closed

SQLiteGrammar compileDropColumn() ignores connection table prefix #22741

tomlankhorst opened this issue Jan 11, 2018 · 0 comments

Comments

@tomlankhorst
Copy link
Contributor

  • Laravel Version: 5.5.28
  • PHP Version: 7.1.8
  • Database Driver & Version: Doctrine DBAL 2.6.3

Description:

SQLiteGrammar ignores table prefixes when ordered to compile a dropColumn statement.
This exception is thrown when SQLiteGrammar queries for existing columns in compileDropColumn resulting in a similar exception:

Doctrine\DBAL\Schema\SchemaException : There is no column with name 'col_name' on table 'table_name_without_prefix'.

This happens when using SQLite driver with a table prefix configured in the connection.

Steps To Reproduce:

  1. Configure a (memory stored) SQLite connection with a table prefix.
  2. Create a migration that creates a column.
  3. Create a migration that drops the same column.

Notes

There is currently no test for SQLite grammar compileDropColumn() and prefixes are tested neither. It seems to me that creating the former would require me to mock many objects (right?). I've fixed the latter by adding a prefix to the grammar in DatabaseSQLiteSchemaGrammarTest though.

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

No branches or pull requests

1 participant