Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-782

[GH-507] Fix unique indexes in CREATE TABLE statements on SQL Anywhere

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      This issue is created automatically through a Github pull request on behalf of deeky666:

      Url: https://github.com/doctrine/dbal/pull/507

      Message:

      SQL Anywhere seems to distinguish between unique indexes and unique constraints. Unique constraints do not allow `NULL` values while unique indexes do.

      A UNIQUE constraint is not the same as a unique index. Columns of a unique index are allowed to be NULL, while columns in a UNIQUE constraint are not. Also, a foreign key can reference either a primary key or a UNIQUE constraint, but cannot reference a unique index since a unique index can include multiple instances of NULL.

      The current implementation create unique constraints instead of unique indexes during `CREATE TABLE` statements which causes ORM to fail as all nullable columns in a unique constraint silently get converted to `NOT NULL`.
      This PR replace unique constraints by unique indexes in `CREATE TABLE`.

        Activity

        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-507] was closed:
        https://github.com/doctrine/dbal/pull/507

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-507] was closed: https://github.com/doctrine/dbal/pull/507

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Doctrine Bot
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: