1

A small sketch of my situation. I have an entity called "ticket" and ticket has a field called "state". The states possible are: "Open" and "Closed". I want to store these states in a MySQL enumeration.

Doctrine doesn't support ENUM out of the box, so I added:

doctrine:
    dbal:
        mapping_types
            enum: string

So far so good.

Now in my doctrine YAML file (Ticket.orm.yml) I added the following:

fields:
    state:
        type: string
        columnDefinition: ENUM('Open', 'Closed')

The problem I encounter is when I run

app/console doctrine:schema:update --force

Is that it stores the field as a VARCHAR, I tried manually adding it to my MySQL database but it overrides it with VARCHAR once again. When I edit the state type to ENUM it tells me:

Unknown column type "enum" requested.

I use Symfony version 2.1

I followed and tried the following solutions:

Community
  • 1
  • 1
Xyzer
  • 111
  • 7

0 Answers0