DDC-3284: Yaml mapping. Comment on table and realtion #4063

Closed
opened 2026-01-22 14:34:34 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 29, 2014).

Originally assigned to: @Majkl578 on GitHub.

Jira issue originally created by user Kilrogg:

Is there any way to comment my tables and table relations with yml schema?
I can comment plain field like this

        prediction:
            type: text
            nullable: true
            length: null
            fixed: false
            options:                
                comment: 'program prediction'

But for relation:

        project:
            targetEntity: File\Entity\File
            cascade: {  }
            mappedBy: null
            inversedBy: null
            joinColumns:
                project:
                    referencedColumnName: id
            orphanRemoval: false
            options:                
                comment: 'File with project data'

Or for whole table:

Program\Entity\Program:
    type: entity
    table: program
    options:
        comment: 'State program table'

It doesn't work at all. When I perform migrations those comments are totally ignored. And I can't find any documentation for yml mapping table commenting

Originally created by @doctrinebot on GitHub (Aug 29, 2014). Originally assigned to: @Majkl578 on GitHub. Jira issue originally created by user Kilrogg: Is there any way to comment my tables and table relations with yml schema? I can comment plain field like this ``` prediction: type: text nullable: true length: null fixed: false options: comment: 'program prediction' ``` But for relation: ``` project: targetEntity: File\Entity\File cascade: { } mappedBy: null inversedBy: null joinColumns: project: referencedColumnName: id orphanRemoval: false options: comment: 'File with project data' ``` Or for whole table: ``` Program\Entity\Program: type: entity table: program options: comment: 'State program table' ``` It doesn't work at all. When I perform migrations those comments are totally ignored. And I can't find any documentation for yml mapping table commenting
admin added the BugWon't FixInvalid labels 2026-01-22 14:34:34 +01:00
admin closed this issue 2026-01-22 14:34:34 +01:00
Author
Owner

@doctrinebot commented on GitHub (Aug 29, 2014):

Comment created by @deeky666:

Commenting tables is a vendor specific feature and therefore not all database vendors support it. I think currently it is only possible to comment tables via mapping for MySQL. The mapping you provided for commenting tables should work however. See here: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php#L247-L249
I'm not quite sure what you mean by commenting relations. Where would you expect Doctrine to add a comment to?

@doctrinebot commented on GitHub (Aug 29, 2014): Comment created by @deeky666: Commenting tables is a vendor specific feature and therefore not all database vendors support it. I think currently it is only possible to comment tables via mapping for MySQL. The mapping you provided for commenting tables should work however. See here: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php#L247-L249 I'm not quite sure what you mean by commenting relations. Where would you expect Doctrine to add a comment to?
Author
Owner

@doctrinebot commented on GitHub (Aug 29, 2014):

Comment created by Kilrogg:

I mean commenting a column that is a foreign key. Like 'project' column above that is a link to Files table and entity.

@doctrinebot commented on GitHub (Aug 29, 2014): Comment created by Kilrogg: I mean commenting a column that is a foreign key. Like 'project' column above that is a link to Files table and entity.
Author
Owner

@doctrinebot commented on GitHub (Sep 1, 2014):

Comment created by @deeky666:

Unfortunately commenting columns part of an association mapping is not possible in ORM at the moment.

@doctrinebot commented on GitHub (Sep 1, 2014): Comment created by @deeky666: Unfortunately commenting columns part of an association mapping is not possible in ORM at the moment.
Author
Owner

@doctrinebot commented on GitHub (Dec 9, 2014):

Comment created by maketime:

I tried doing this with annotations by adding a column annotation to the relation, but this effectively removed the relation alltogether. So no workaround yet.

@doctrinebot commented on GitHub (Dec 9, 2014): Comment created by maketime: I tried doing this with annotations by adding a column annotation to the relation, but this effectively removed the relation alltogether. So no workaround yet.
Author
Owner

@doctrinebot commented on GitHub (Dec 12, 2014):

Comment created by @deeky666:

Commenting foreign key columns is simply not supported yet via ORM mapping.

@doctrinebot commented on GitHub (Dec 12, 2014): Comment created by @deeky666: Commenting foreign key columns is simply not supported yet via ORM mapping.
Author
Owner

@Majkl578 commented on GitHub (Dec 19, 2017):

YAML is going to be removed in Doctrine 3.0.

@Majkl578 commented on GitHub (Dec 19, 2017): YAML is going to be removed in Doctrine 3.0.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4063