Ticket #1585 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

Oracle building model fails due to "precision" element

Reported by: tchakkapark Owned by: jwage
Priority: minor Milestone: 1.0.4
Component: Import/Export Version: 1.0.3
Severity: Keywords: oracle build-model precision build-schema
Cc: Has Test: no
Status: Pending Core Response Has Patch: yes

Description (last modified by tchakkapark) (diff)

I am using Symfony 1.1 with the sfDoctrinePlugin along with PHP version 5.2.6. I've confirmed that this happens with the 1.0.x version of Doctrine, as well as the latest 1.1 version of doctrine in SVN (changeset 5110).

My Oracle database has precision set to some of the number datatypes.

When reverse-engineering using

symfony doctrine:build-schema

The schema.yml gets generated, but also includes the precision:

ACTIVITIES:
  tableName: ACTIVITIES
  columns:
    id:
      type: integer(8)
      autoincrement: true
      primary: true
    activity_id:
      notnull: true
      type: integer(22)
      precision: '12'

When that YML syntax is passed to

symfony doctrine:build-model

I encounter the following:

Invalid schema element named "precision" at path "ACTIVITIES->columns->activity_id

However, the ORM builds fine when I remove any precision items in the YML syntax.

I'm unsure if having that element is necessary at all for the purposes of Doctrine.

Change History

Changed 9 months ago by tchakkapark

  • description modified (diff)

Changed 9 months ago by tchakkapark

  • description modified (diff)

Changed 9 months ago by tchakkapark

  • has_patch set

Proposed Patch:

/Import/Oracle.php, line 146 (changset 5110):

            $descr[$val['column_name']] = array(
               'name'       => $val['column_name'],
               'notnull'    => (bool) ($val['nullable'] === 'N'),
               'ntype'      => $val['data_type'],
               'type'       => $decl['type'][0],
               'alltypes'   => $decl['type'],
               'fixed'      => $decl['fixed'],
               'unsigned'   => $decl['unsigned'],
               'default'    => $val['data_default'],
               'length'     => $val['data_length'],
               'precision'  => $val['data_precision'], //Remove this line
               'scale'      => $val['scale'],
            );
        }

Changed 9 months ago by jwage

  • version changed from 1.1-DEV to 1.0.3
  • milestone changed from 1.1.0 to 1.0.4

Changed 9 months ago by adrive

  • status changed from new to closed
  • resolution set to fixed

(In [5113]) [1.0, 1.1] Fixes #1585: Oracle building model fails due to precision element - precision in number type is now data_length

Note: See TracTickets for help on using tickets.