Doctrine 1
  1. Doctrine 1
  2. DC-105

notnull: false is ignored for integers with the mssql export

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.4, 1.2.0-ALPHA1, 1.2.0-ALPHA2
    • Fix Version/s: 1.2.0-ALPHA3
    • Component/s: Import/Export
    • Labels:
      None
    • Environment:
      Windows XP Professional SP3, SQL Server Express 2008

      Description

      The following yml schema will result in a table with the integer field marked as not null

      MyTable:
      columns:
      intfield:
      type: integer
      notnull: false

      I have traced this back to line 244 in the getIntegerDeclaration function in lib/Doctrine/DataDict/Mssql.php

      $notnull = (isset($field['notnull']) && $field['notnull']) ? ' NOT NULL' : '';

      should be

      $notnull = (isset($field['notnull']) && $field['notnull']) ? ' NOT NULL' : ' NULL';

      This fixes the issue for us and hasn't created any problems thus far.

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: