jazzband / jazzband/django-eav2

cannot cast type bigint to uuid

Open
#455 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
369
Forks
64
Avg merge
1m
Merged PRs (30d)
7

Description

Hello, I put version 1.5.0 on the project from which all this started and I noticed something that is due to the migration file 0010. In fact, we can't go from a BigAutoField to a UUIDField directly, nor can we do the reverse: to do so, we'd have to go through a CharField, which leads us to the fact that migration 0010 has to be a migration that transforms the id field into a Charfield rather than a BigAutoField. Otherwise, we won't be able to use the UUIDField option for ids in this version without using the step of conveying the pk into a CharField and then now into a uuid, whereas we'd like a project without data to be able to choose what type it wants for its basic pk. Here's the error

django.db.utils.ProgrammingError: cannot cast type bigint to uuid
LINE 1: ..."eav_attribute" ALTER COLUMN "id" TYPE uuid USING "id"::uuid

Contributor guide

Open the contributing guide

Research direction

Inspect migration 0010 and reproduce the reported bigint-to-uuid failure on a fresh project. Verify that the migration permits choosing either BigAutoField or UUIDField for the primary key without requiring a direct bigint-to-uuid cast.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.