Skip to content


DBAL-693: Schema migration issue then column changes. #1915

doctrinebot opened this Issue · 3 comments

2 participants


Jira issue originally created by user

Migration rise an error then trying ALTER table. Seems like an order problem. Second re-run migration always fix issue. Happens then changes columns in the table.

        /*** @noinspection PhpUndefinedMethodInspection **/
        $schemaManager = $db->getSchemaManager();
        /*** @noinspection PhpUndefinedMethodInspection **/
        $fromSchema = $schemaManager->createSchema();
        /*** @noinspection PhpUndefinedMethodInspection **/
        $sql = $fromSchema->getMigrateToSql($schema, $db->getDatabasePlatform());
        foreach ($sql as $request) {
            /*** @noinspection PhpUndefinedMethodInspection **/

Rise error looks like

 An exception occurred while executing 'ALTER TABLE error CHANGE time time TIMESTAMP DEFAULT CURRENT*TIMESTAMP on update CURRENT*TIMESTAMP':

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydb.error' doesn't exist

Comment created by @beberlei:

This is not enough information, i need the schema from the database and the local schema that helps me to reproduce this error. With this information i cannot reproduce this. Please provide feedback.


Comment created by

I've found there problem is. Seems like SchemaManager unable undertand '. format as table name for createTable() method. After use just table name issue disappears.


Issue was closed with resolution "Invalid"

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.