Doctrine 1
  1. Doctrine 1
  2. DC-951

Error in generating the field size and error in the generation of the date fields for postgres

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      apacha2, linux, Symfony 1.4

      Description

      collaboration of vtamara@pasosdejesus.org and jeronimo0000@gmail.com

      While we developed a tool with symfony 1.4 and postgresql database we found errors in the generated schema.yml which I describe below

      1 - Error in generating of field size of varchars
      2 - Error in the generation of date fields

      We found the following solution

      — Doctrine/Import/Pgsql.php.orig 2010-12-23 17:48:00.160271000 -0500
      +++ Doctrine/Import/Pgsql.php 2010-12-23 18:01:59.252271002 -0500
      @@ -168,11 +168,14 @@
      $columns = array();
      foreach ($result as $key => $val) {
      $val = array_change_key_case($val, CASE_LOWER);

      • if (strtolower($val['type']) === 'character varying') {
        + if (strtolower($val['type']) === 'varchar') { // get length from varchar definition $length = preg_replace('~.*\(([0-9]*)\).*~', '$1', $val['complete_type']); $val['length'] = $length; }

        + if ($val['type'] == 'date')

        { + $val['type'] = $val['complete_type'] = 'timestamp'; + }

      $decl = $this->conn->dataDict->getPortableDeclaration($val);

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            fernando guerrero
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: