I have scoured the internet, books and forums looking for an answer to this, and am hoping someone on here can help.
I have a standard Symfony 2 project setup, using entity annotations in doctrine. The problem I have is that any of my entities that contain a datetime type constantly want to migrate. So after initial migration to the db i can re run docrine:schema:update --dump-sql and I still see this:
ALTER TABLE log CHANGE date date DATETIME NOT NULL;
ALTER TABLE message CHANGE created_on created_on DATETIME NOT NULL, CHANGE updated_on updated_on DATETIME NOT NULL;
ALTER TABLE module CHANGE start_date start_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL, CHANGE end_date end_date DATETIME NOT NULL;
ALTER TABLE scheduled_commands CHANGE last_execution last_execution DATETIME NOT NULL;
I could sit here all day running migrations and checking this and it will stay the same. The entities have nothing special in them either:
/**
* @var \DateTime
*
* @ORM\Column(name="start_date", type="datetime")
*/
private $startDate;
/**
* @var \DateTime
*
* @ORM\Column(name="end_date", type="datetime")
*/
private $endDate;
Does anyone have any ideas on this? I am now completely stumped :( .
The mysql setup is current 5.6.25 too
the columns structure look like this once migrated
`start_date` | DATETIME | NOT NULL,
`end_date` | DATETIME | NOT NULL