Dbal: Using custom column definition trigger schema update every time

Created on 1 Mar 2017  路  1Comment  路  Source: doctrine/dbal

bin/console doctrine:schema:update --dump-sql

ALTER TABLE items CHANGE id id int(11) NOT NULL AUTO_INCREMENT;

Same message after bin/console doctrine:schema:update --force execution.

bin/console doctrine:schema:validate:

[Database] FAIL - The database schema is not in sync with the current mapping file.
/**
 * @var int
 *
 * @ORM\Column(type="integer", options={"unsigned": true}, unique=true, columnDefinition="int(11) NOT NULL AUTO_INCREMENT")
 */
private $id;
mysql> show create table items;
+------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table                              | Create Table                                                                                                                                                                                                                                                                                                  |
+------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| items | CREATE TABLE `items` (
  `checksum` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`checksum`),
  UNIQUE KEY `...` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |
+------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Platform: MySQL 5.7

Bug Can't Fix Schema Comparison Schema Definition Schema Introspection

>All comments

This is a known limitation that we cannot fix.

Was this page helpful?
0 / 5 - 0 ratings