Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-434

Incorrect type mapping on Oracle Platform

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Can't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Platforms
    • Security Level: All
    • Labels:
      None
    • Environment:
      Oracle 10g on Windows, using Doctrine 2 with Symfony2

      Description

      Hello,

      I'm noticed a strange behaviour when I executed a migration for my Oracle database. Doctrine detects changes on all date columns, generating queries like:

      ALTER TABLE the_table MODIFY (the_date DATE DEFAULT NULL);

      even if the entity property was not modified. Check in out the Doctrine 2 source code I've detected that Doctrine map the DATE Oracle columns as datetime type, but entity date property are mapped as date (as it should be), so Doctrine believes that entity property and column type are different and generate the alter query.

      I found the problem on the method Doctrine\DBAL\Platforms\OraclePlatform::initializeDoctrineTypeMappings, when it say 'date' => 'datetime' should say 'date' => 'date', that fix the migration problem and does not break my application.

      Was a typo?

      Thanks!

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Damián Nohales
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: