I'm having problems updating the schema in Symfony2.
I imported the database into Symfony2 using the doctrine and created all the ORM files in YML.
I created all the entities from this metadata, and it worked fine, but if I want to change the database schema using the orm.yml files, it does not update my database or even update the objects when I regenerate them.
Import created orm.yml files in / SRC / {name} / {mine} bundle / Resources / configuration / Doctrine / metadata / ORM / {table} .orm.yml
It was created without errors.
When I do this:
php app/console doctrine:schema:update
it displays:
ALTER TABLE accounttypes CHANGE description description VARCHAR(45) NOT NULL
So I:
php app/console doctrine:schema:update
and
Updating database schema... Database schema updated successfully! "1" queries were executed
I can do it again and again, and the same request appears, and I execute it, and it tells me that it is done, but again shows that it needs to be done again.
Then I went into the orm.yml files and changed them dramatically, but there were nothing new requests, except for those that are always there when I do this.
File AccountTypes.orm.yml
Accounttypes: type: entity table: accounttypes fields: description: id: true type: string length: 45 fixed: false nullable: false generator: strategy: IDENTITY lifecycleCallbacks: { }
Change to this:
Accounttypes: type: entity table: accounttypes id: id: type: integer generator: { strategy: AUTO } fields: description: id: true type: string length: 50 lifecycleCallbacks: { }
And I still said:
ALTER TABLE accounttypes CHANGE description description VARCHAR(45) NOT NULL
I also tried using the DoctrineMigrationsBundle, and the same query detects the need. I am migrating; It says that the request is being executed, and when I use it again, the same request appears.
Does anyone know how this happens? I am stuck on this, so any help is greatly appreciated.