Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using UUIDField as EAV2_PRIMARY_KEY_FIELD value #478

Open
wants to merge 46 commits into
base: master
Choose a base branch
from

Conversation

mathiasag7
Copy link
Contributor

Checklist

  • I have double checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc.)
  • I have created at least one test case for the changes I have made
  • I have updated the documentation for the changes I have made
  • I have added my changes to the CHANGELOG.md

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Related issue(s)

Format is:

mathiasag7 and others added 30 commits September 6, 2023 14:24
@Dresdn
Copy link
Contributor

Dresdn commented Mar 22, 2024

@mathiasag7 - Can you rebase this? For example, the PR still has eav/models.py

@mathiasag7
Copy link
Contributor Author

I see, but that doesn't help much. In fact, it return "Current branch master is up to date."

@mathiasag7
Copy link
Contributor Author

Also, I want to bring to your attention that when you check the tests and run makemigrations, it will create a migration file, usually named 0012, which is correct. However, after verifying that the code works fine, please remember to remove this migration file. Failing to do so could lead to crashes when attempting to use a UUID as an ID.

The issue arises because if the migration file sets the ID as an AutoField or a UUIDField, the user of the package cannot change it to the other type afterward. Therefore, the package needs to be flexible in this regard. Specifically, it should initially set the ID as a CharField. Then, when the user specifies their preference for the ID type, the package should automatically adjust it accordingly, removing the CharField.

I hope this clarification is clear, let me know if not.

@Dresdn
Copy link
Contributor

Dresdn commented Mar 22, 2024

I see, but that doesn't help much. In fact, it return "Current branch master is up to date."

You need to re-sync your fork at https://github.com/mathiasag7/django-eav2/tree/master For example, this file should not be there: https://github.com/mathiasag7/django-eav2/blob/master/eav/models.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot cast type bigint to uuid
2 participants