#23401 closed Bug (fixed)
"django_admin_log"."object_id" has wrong type in djangoproject database
Reported by: | Tim Graham | Owned by: | nobody |
---|---|---|---|
Component: | *.djangoproject.com | Version: | |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In the production database, "django_admin_log"."object_id"
has type integer
instead of text
(LogEntry.object_id
is a TextField
and has been since at least magic removal; I guess it was IntegerField
before and never properly migrated). Can we manually run a query to change the type?
Discovered this today when James couldn't create the release objects in the admin. Checking the traceback it was DataError: invalid input syntax for integer: "1.4.15"
Traced it down and had to roll back this in the meantime:
https://github.com/django/djangoproject.com/commit/016c7042134bde30cf5d2b67b5bbf723b4d7bc15
Ran this query:
ALTER TABLE django_admin_log ALTER COLUMN object_id TYPE text;