Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2238

doctrine:schema:update partially broken

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: Tools
    • Environment:
      OS X 10.7.5
      PHP 5.4.4
      Postgres SQL 9.1.6

      also confirmed on:
      Linux (Debian testing, Kernel 2.6.32)
      PHP 5.4.4
      PostgreSQL 9.1.9
      Doctrine 2.3.2

      Description

      the app/console doctrine:schema:update command generates a seemingly random number of statements like these:

      ALTER TABLE geodata ALTER humidity SET ;
      ALTER TABLE geodata ALTER lake SET ;
      ALTER TABLE message ALTER translate SET ;

      which are obvious invalid SQL commands. The mappings are fine, validate and the application works just fine. Here's an example from the mapping files including two of the above statements:

      <field name="coast" type="boolean"/>
      <field name="lake" type="boolean"/>
      <field name="river" type="boolean"/>
      <field name="humidity" type="float"/>
      <field name="biome" type="string"/>

      I am using doctrine2-spatial as an extension for GIS information. This problem shows up both in entities using spatial data and entities not using spatial data.

      I'll gladly help debug this, as right now I can't update my dev database with --force, I need to use --dump-sql and filter out the invalid lines.

        Issue Links

          Activity

          Hide
          Benjamin Eberlei added a comment -

          Can you dump the SchemaDiff/ColumnDiff instances that are returned from lib/Doctrine/DBAL/Schema/Comparator.php?

          Show
          Benjamin Eberlei added a comment - Can you dump the SchemaDiff/ColumnDiff instances that are returned from lib/Doctrine/DBAL/Schema/Comparator.php?
          Hide
          Tom Vogt added a comment -

          requested dump of SchemaDiff

          Show
          Tom Vogt added a comment - requested dump of SchemaDiff
          Hide
          Tom Vogt added a comment - - edited

          added in the file schemadiff.txt - I added this in Schematool.php - getUpdateSchemaSql():

          $comparator = new Comparator();
          $schemaDiff = $comparator->compare($fromSchema, $toSchema);
          \Doctrine\Common\Util\Debug::dump($schemaDiff, 6);

          if you need other output, just tell me what entity to dump and where. I'll be happy to help.

          The file also contains the buggy update statements it creates towards the end. There's a few non-crucial bugs included, where it alters the geospatial columns to themselves (i.e. river.course already is a geometry/linestring). I don't worry about those because they don't break anything.

          Show
          Tom Vogt added a comment - - edited added in the file schemadiff.txt - I added this in Schematool.php - getUpdateSchemaSql(): $comparator = new Comparator(); $schemaDiff = $comparator->compare($fromSchema, $toSchema); \Doctrine\Common\Util\Debug::dump($schemaDiff, 6); if you need other output, just tell me what entity to dump and where. I'll be happy to help. The file also contains the buggy update statements it creates towards the end. There's a few non-crucial bugs included, where it alters the geospatial columns to themselves (i.e. river.course already is a geometry/linestring). I don't worry about those because they don't break anything.
          Hide
          Tom Vogt added a comment -

          Is there any update on this? I'm still having this issue, with many different entities, always the same problem, for example:

          ALTER TABLE event ALTER priority SET ;

          Which is an integer field on an entity that doesn't have any GIS elements, so I'm not even sure if it's caused by that anymore.

          Show
          Tom Vogt added a comment - Is there any update on this? I'm still having this issue, with many different entities, always the same problem, for example: ALTER TABLE event ALTER priority SET ; Which is an integer field on an entity that doesn't have any GIS elements, so I'm not even sure if it's caused by that anymore.
          Hide
          Benjamin Eberlei added a comment -

          Tom Vogt I added a fix for PostgreSQL today, can you verify again if this works? Its included in the 2.3 branch.

          Show
          Benjamin Eberlei added a comment - Tom Vogt I added a fix for PostgreSQL today, can you verify again if this works? Its included in the 2.3 branch.
          Show
          Benjamin Eberlei added a comment - Duplicate of http://www.doctrine-project.org/jira/browse/DBAL-504

            People

            • Assignee:
              Benjamin Eberlei
              Reporter:
              Tom Vogt
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: