symfony: [ERROR] The database schema is not in sync with the current mapping file.

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 4.0.9
[ERROR] The database schema is not in sync with the current mapping file.

When using @ORM\Column(type="string", nullable=true) Doctrine annotation there is still error after executing php bin/console doctrine:schema:validate console command.

Tested with databases: SQLite, MariaDB.

But in the application itself all queries are working fine.

If nullable=true is not using, then schema validation runs without error. Also if using @ORM\Column(type="text", nullable=true) (type=TEXT) there is no validation error.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

@parijke According to another github issue related to this issue, I setted server_version: 'mariadb-10.3.17' in doctrine.yaml. Unfortunately, I can’t find it now, but maybe this helps you. For me the error is gone since I added this.

This one fixed it for me: php bin/console doctrine:schema:update --force --complete --dump-sql

Well, commenting on an issue closed 6 years ago while using a version from 3 years ago was not making that clear to be honest (and the Doctrine team won’t be able to do anything for you as they already fixed the issue years ago)