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

doctrinebot opened this Issue Nov 29, 2013 · 3 comments

2 participants


Jira issue originally created by user maksim.muruev@gmail.com:

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 maksim.muruev@gmail.com:

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 Dec 7, 2015
@beberlei beberlei was assigned by doctrinebot Dec 7, 2015
@doctrinebot doctrinebot closed this Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment