Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-747

Add support for table, column and indexes comments

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:
      None

      Description

      It would be nice to add support for table comments, column comments and indexes comments, i.e.

      @Table(
          name="ecommerce_products",
          comment="Contains products",
          indexes={@index(name="search_idx", comment="Makes finding people by name easier", columns={"name", "email"})}
      )
      
      @Column(type="integer", comment="Stores the user's age, in years")
      

      MySQL supports comments via ALTER TABLE since 4.1.
      PostgreSQL support comments via COMMENT at least since 7.4.
      SQLite doesn't appear to support table, column or indexes comments as of 3.7.
      Oracle supports comments on tables and columns via COMMENT at least since 10.1. It doesn't appear to support comments on indexes.

      For databases that don't support those persistent comments, you could use normal SQL comments in the table definition. Of course they wouldn't be stored by the database, but at least they would appear in the generated schema, that's better than nothing.

        Activity

        s9e created issue -
        s9e made changes -
        Field Original Value New Value
        Description It would be nice to add support for table comments, column comments and indexes comments, i.e.

        {code}
        @Table(
            name="ecommerce_products",
            comment="Contains products",
            indexes={@index(name="search_idx", comment="Makes finding people by name easier", columns={"name", "email"})}
        )

        @Column(type="integer", comment="Stores the user's age, in years")
        {code}



        MySQL supports comments via [ALTER TABLE|http://dev.mysql.com/doc/refman/4.1/en/create-table.html] since 4.1.
        PostgreSQL support comments via [COMMENT|http://www.postgresql.org/docs/7.4/static/sql-comment.html] at least since 7.4.
        SQLite [doesn't appear to support table, column or indexes comments|http://www.sqlite.org/cvstrac/wiki?p=UnsupportedSql] as of 3.7.
        Oracle supports comments on tables and columns via [COMMENT|http://download.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_4009.htm#SQLRF01109] at least since 10.1. It doesn't appear to support comments on indexes.

        For databases that don't support those persistent comments, you could use normal SQL comments in the table definition. Of course they wouldn't be stored by the database, but at least they would appear in the generated SQL, that's better than nothing.
        It would be nice to add support for table comments, column comments and indexes comments, i.e.

        {code}
        @Table(
            name="ecommerce_products",
            comment="Contains products",
            indexes={@index(name="search_idx", comment="Makes finding people by name easier", columns={"name", "email"})}
        )

        @Column(type="integer", comment="Stores the user's age, in years")
        {code}



        MySQL supports comments via [ALTER TABLE|http://dev.mysql.com/doc/refman/4.1/en/create-table.html] since 4.1.
        PostgreSQL support comments via [COMMENT|http://www.postgresql.org/docs/7.4/static/sql-comment.html] at least since 7.4.
        SQLite [doesn't appear to support table, column or indexes comments|http://www.sqlite.org/cvstrac/wiki?p=UnsupportedSql] as of 3.7.
        Oracle supports comments on tables and columns via [COMMENT|http://download.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_4009.htm#SQLRF01109] at least since 10.1. It doesn't appear to support comments on indexes.

        For databases that don't support those persistent comments, you could use normal SQL comments in the table definition. Of course they wouldn't be stored by the database, but at least they would appear in the generated schema, that's better than nothing.
        s9e made changes -
        Component/s Mapping Drivers [ 10044 ]
        Component/s ORM [ 10012 ]
        s9e made changes -
        Summary Add support fo table, column and indexes comments Add support for table, column and indexes comments
        Benjamin Eberlei made changes -
        Workflow jira [ 11771 ] jira-feedback [ 13870 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 13870 ] jira-feedback2 [ 15734 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15734 ] jira-feedback3 [ 17991 ]

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            s9e
          • Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated: