Files
zeekay 652eddfa0f Finish the review and stamp rename instead of half-holding it
A dependency names an app by its LABEL. The label moved to "review" while the
25 dependencies that spell it did not, so every one pointed at an app that does
not exist and the graph raised NodeNotFoundError at import — which is how a
rename reached production as a 500 on /_health and took the backend test suite
with it. The previous pass reverted the label to hold the two halves together;
this moves them together instead.

Three spellings had to move, and only the first is a dependency tuple: the
`to=` on a ForeignKey and the table named in 0018's raw SQL are the other two,
and each one fails at a different moment — graph build, state build, and
execute — so fixing only what the last traceback showed just moves the error.

The rows in django_migrations and the tables they describe carried the old
label too, and no migration can rename those from inside the graph it belongs
to. Both apps were empty — nine tables, zero rows, one internal foreign key —
so the deploy step was to drop them and let the graph rebuild under the name it
actually has. Done against production: ledger now review=26, stamp=1, tables
review_* and stamp_*, nothing pending.

0025's filename still says stamphog. A migration's name is its identity in the
ledger, so renaming the file would orphan the row it already wrote.
2026-08-09 11:14:23 -07:00

24 lines
1.1 KiB
Python

from django.apps import AppConfig
class ReviewConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "products.review.backend"
# A dependency names an app by its LABEL, so the label and the 25 dependencies
# that spell it have to move together — half of that rename reaches production
# as NodeNotFoundError at import time, which takes the health endpoint and the
# backend test suite with it. They move together now.
#
# The rows already in django_migrations, and the tables they describe, were
# named for the old label too, and no migration can rename them from inside the
# graph it belongs to. Both apps were empty — nine tables, zero rows — so the
# deploy step was to drop them and let the graph build itself under the name it
# actually has, rather than to carry the old one forward.
label = "review"
def ready(self) -> None:
# Deferred import: models aren't loadable at module import time, and ready() must stay light.
from products.review.backend import receivers # noqa: PLC0415
receivers.connect()