Be sure to commit the migration files and run execute them when you deploy. For that reason, you should create public getters and setters for all the fields you need to modify from outside of the class.
If you use an IDE like Php Storm, it can generate these for you.
Scheme is Shop has a delivery Mode : Then, above exception is thrown BUT: When I put in on a doctrine transaction, it works perfectly, and it also works when I remove the "not nullable" constraint, delivery Mode is perfectly persisted.
It seems to me there a bug with the order of executing the inserts, the delivery Mode should be inserted, then the shop, I think that is not the case Comment created by andy_b_84: I guess I'm stupid to ask, but isn't your foreign key not nullable, which you cannot set because you don't have any key right now? (Or pgdump, or whatever DBS you're using) @Ocramius at which point does the nested entity get the parent entity ID injected?
It would help us a lot to identify and fix the issue you're describing.