🐉 Boss: the collapsed storeroom

Exercise 6 of 6 in chapter 8 · 340 XP · 5 objectives checked by tests

Topics covered: DebuggingMigrationsManyToManyN+1 queriesPagination

Pippin took advantage of a quiet night to “tidy up the storeroom”. He added the allergens to the dish pages, and while he was at it, he “simplified two or three things”. The next morning, Bruna finds the tavern upside down:

Your mission

Four breakdowns, four different places. Find them and fix them, without breaking anything else.

Your tools

In the Console tab:

doctrine:migrations:status
doctrine:migrations:migrate prev
doctrine:schema:validate
dbal:run-sql "SELECT COUNT(*) FROM plat_ingredient"

In the preview: the SQL query counter at the bottom right, a dish page (/dish/dwarf-stew) and the guestbook (/guestbook).

Tavern tip

All these breakdowns have one thing in common: none of them produces an error. The migration runs, the page displays, the command says “OK”. You have to look at what really happens: in the database, in the counter, on the page.