Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-289

Wrong diff between Oracle 'Date' type and Metadata 'Date' type

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: Platforms
    • Security Level: All
    • Labels:
      None
    • Environment:
      Oracle Express 11g and doctrine-dbal 2.2.2

      Description

      Hi,
      I want to update my schema but I am getting the following error message:

      [Doctrine\DBAL\Driver\OCI8\OCI8Exception]
      ORA-01442: column to be modified to NOT NULL is already NOT NULL

      --dump-sql says:

      ALTER TABLE CONSIGNMENTS MODIFY (SDGDATE  DATE DEFAULT NULL);

      The current table structure looks like that:

      Column Name Data Type Nullable Default Primary Key
      SDGDATE DATE Yes NULL

      Mapping definition:

      /**
       * @ORM\Column(name="SDGDATE",type="date",nullable=true)
       */
      private $sdgdate;
      

      I think there is a problem with the comparison between Oracles 'Date' type and the Metadata 'Date' type. I am used to use MySQL as DBMS but our customer uses Oracle. MySQL's 'datetime' and Oracle's 'date' type are store the same data.

      I am not sure what should be done here. Because this could lead to confusion for all Oracle user.

      Maybe there could be a request to the platform in the Schema Comparator here:

      public function diffColumn(Column $column1, Column $column2)
      {
          $changedProperties = array();
          if ( $column1->getType() != $column2->getType() ) {
              $changedProperties[] = 'type';
          }
          // ...
      }
      

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Christian Stoller
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: