Doctrine 1
  1. Doctrine 1
  2. DC-691

No sequence_id increment after fixtures loaded, while setting their ids

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.3
    • Component/s: Data Fixtures
    • Labels:
      None
    • Environment:
      Ubuntu lucid up to date - Symfony 1.4.4 - Postgresql 8.4

      Description

      If I force id in fixtures (they are autoincremented in model), the sequence is not set correctly in postgresql.

      Model :
      T_Company:
      actAs:
      Timestampable: ~
      Searchable:
      fields: [name]
      columns:
      company_id:

      { type: integer, notnull: true, autoincrement: true, primary: true }

      dn:

      { type: string(255) }

      name:

      { type: string(127), notnull: true}

      relations:
      RssSettings:

      { local: company_id, foreign: rsssettings_id, foreignAlias: CompanySettings, refClass: J_Company_Rsssettings, class: T_RssSettings }

      ParentCompany:

      { local: company_id, foreign: parent_company_id, foreignAlias: ChildCompany, refClass: J_Company_Company, class: T_Company }

      ParentLinkType:

      { local: company_id, foreign: parent_company_id, refClass: J_Company_Company, class: S_CompanyLinkType }

      Fixtures :
      T_Company:
      A:
      company_id: 1
      name: A
      dn: A
      B:
      company_id: 2
      name: B
      dn: B
      C:
      company_id: 3
      name: C
      dn: C

      Postgresql :
      sl3dev=# select * from t__company;
      company_id | dn | name | created_at | updated_at
      -------------------------------------------------------------------------------------------------------------------------------------------------------
      1 | A | A | 2010-05-18 16:55:12 | 2010-05-18 16:55:12
      2 | B | B | 2010-05-18 16:55:12 | 2010-05-18 16:55:12
      3 | C | C | 2010-05-18 16:55:12 | 2010-05-18 16:55:12

      sl3dev=# select nextval('t__company_company_id_seq'::regclass);
      nextval
      ---------
      1
      (1 ligne)

      1 instead of 4 naturally.

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: