Doctrine 1
  1. Doctrine 1
  2. DC-834

When altering an existing column PGSQL can't convert to SERIAL for autoincrement

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: Attributes, Migrations
    • Labels:
      None
    • Environment:
      PostgreSQL 8.4

      Description

      If you have an existing column Postgresql won't allow you to use the type SERIAL for altering the column.

      First create a column cat_id on category of integer type. Then run the following migration:

      migration.php
          public function up()
          {
              $this->changeColumn('category', 'cat_id', 'integer', '4', array(
                   'unsigned' => '',
                   'primary' => '1',
                   'autoincrement' => '1',
                   ));
          }
      

      Instead of using type SERIAL doctrine would have to simply alter the column then add a sequence on it's own.

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated: