mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Schema error not caught by validate: Column & JoinColumn #5219
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pbowyer on GitHub (Aug 16, 2016).
If I make a mistake and use the following column definition:
The table is created without issue, but the foreign key is omitted.
Running
doctrine:schema:validatedoes not produce a warning, so all appears good.This silent behaviour is not good (it took a long time to figure out the bug), and I would like to improve this. Three possible fixes are:
JoinColumnis set, silently ignore theColumndefinitiondoctrine:schema:validatedoctrine:schema:validateand when creating/updating tablesWhat would the team endorse?
For those not working with D2 every day, the correct code is as follows: