Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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

Change History (2)

comment:1 by Tim Graham, 10 years ago

Resolution: fixed
Status: newclosed

Ran this query: ALTER TABLE django_admin_log ALTER COLUMN object_id TYPE text;

comment:2 by Tim Graham <timograham@…>, 10 years ago

In a5965f1e0a2c3609fb9612cb31b2b71cf1bff64f/djangoproject.com:

Removed hack to disable admin logging for releases app; refs #23401.

Note: See TracTickets for help on using tickets.
Back to Top