App\Entity\TicketPieceJointe:
    type: entity
    table: ticket_piece_jointe
    indexes:
        idx_ticket_piece_ticket:
            columns: [ ticket_id ]
        idx_ticket_piece_message:
            columns: [ ticket_message_id ]
        idx_ticket_piece_date:
            columns: [ date_upload ]
    fields:
        id:
            id: true
            type: integer
            unsigned: false
            nullable: false
            generator:
                strategy: IDENTITY
        nom:
            type: string
            length: 255
            nullable: false
        cheminFichier:
            type: string
            length: 500
            nullable: false
            column: chemin_fichier
        mimeType:
            type: string
            length: 100
            nullable: true
            column: mime_type
        taille:
            type: integer
            nullable: true
        dateUpload:
            type: datetime
            nullable: false
            column: date_upload
    manyToOne:
        ticket:
            targetEntity: Ticket
            inversedBy: piecesJointes
            joinColumn:
                name: ticket_id
                referencedColumnName: id
                nullable: true
                onDelete: CASCADE
        ticketMessage:
            targetEntity: TicketMessage
            inversedBy: piecesJointes
            joinColumn:
                name: ticket_message_id
                referencedColumnName: id
                nullable: true
                onDelete: CASCADE
    lifecycleCallbacks:
        prePersist: [setDateUploadValue]
