Empty database is not valid #6978

Open
opened 2026-01-22 15:42:30 +01:00 by admin · 1 comment
Owner

Originally created by @vlady777 on GitHub (May 16, 2022).

Bug Report

Q A
BC Break no
Version 2.12.2

Summary

There is a problem with doctrine:schema:validate command when database is empty (no entities and tables).

Current behavior

doctrine:schema:validate fails when no enitties and tables

$ php bin/console doc:sch:val

Mapping

[OK] The mapping files are correct.

Database

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

$ php bin/console doc:sch:upd --dump-sql

[OK] No Metadata Classes to process.

How to reproduce

  1. Create new project with empty database and no entities
  2. Run doctrine:schema:validate command

Expected behavior

Schema should be valid.

Originally created by @vlady777 on GitHub (May 16, 2022). ### Bug Report | Q | A |------------ | ------ | BC Break | no | Version | 2.12.2 #### Summary There is a problem with doctrine:schema:validate command when database is empty (no entities and tables). #### Current behavior doctrine:schema:validate fails when no enitties and tables $ _php bin/console doc:sch:val_ Mapping [OK] The mapping files are correct. Database [ERROR] The database schema is not in sync with the current mapping file. $ _php bin/console doc:sch:upd --dump-sql_ [OK] No Metadata Classes to process. #### How to reproduce 1. Create new project with empty database and no entities 2. Run doctrine:schema:validate command #### Expected behavior Schema should be valid.
Author
Owner

@greg0ire commented on GitHub (May 17, 2022):

Do you get more details when you try this with maximum verbosity? php bin/console -vvv doc:sch:upd --dump-sql Asking because of 2e4a872272/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php (L79-L87)

@greg0ire commented on GitHub (May 17, 2022): Do you get more details when you try this with maximum verbosity? `php bin/console -vvv doc:sch:upd --dump-sql` Asking because of https://github.com/doctrine/orm/blob/2e4a8722721b934149ff53b191522a6829b6d73b/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php#L79-L87
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6978