-
Notifications
You must be signed in to change notification settings - Fork 11
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
Using ULID field for primary key causing migration to keep being recreated #65
Comments
I ran into this as well. I tracked it down to the
then pass |
Awesome, thanks for the heads up. This solution worked beautifully for me too. Cheers! |
My apologies for the delay, I missed the notifications for this issue. A few versions back, support for monotonic randomness was added to ulid-py. This made the randomness implementation pluggable and the exported API is now bound methods on a constant object instead of pure functions as before. I'll look to see if I can expose a pure function from |
There is even a bug report to Django for it from someone. |
I understand this is an issue originating from a downstream project, however this prevents anyone from using I'd be happy to provide a patch for this so this works out-of-the-box again if you can point me in the correct direction @ahawker. |
I'm using ULID as the primary key for a couple of my models, as well as ULID for a couple non-PK keys. When i run python manage.py makemigrations, a migration is made attempting to redeclare the ulid fields being used as pk, but the non-pk fields aren't affected which is good. If I try to run the migration, it results with an error, reproduced below.
Not sure why django wants to keep creating this migration, as its the exact same operation as the initial migration.
models.py:
Initial migration:
Migration that keeps getting recreated every time I run python manage.py makemigrations:
The error I get if I try to run this superfluous migration:
The text was updated successfully, but these errors were encountered: