Skip to content

doctrine:migrations:refresh command does not work on reserved MySQL keywords #87

@fsasvari

Description

@fsasvari

When I try to run "doctrine:migrations:refresh", the following error occurs:

Doctrine\DBAL\Exception\SyntaxErrorException  : An exception occurred while executing 'DROP TABLE order':

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order' at line 1

The problem occurs when trying to drop a table which has some of the reserved MySQL keywords like ORDER.

When you look at src/Console/ResetCommand.php, line 91:

$schema->dropTable($table);

The problem is solved if you put quotes ` between $table variable:

https://i.imgur.com/r9E8yz0.png

Is there any other solution to the problem or a possible fix?

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