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

Update fails #24

Open
wiktorwojcikowski opened this issue Nov 10, 2015 · 6 comments
Open

Update fails #24

wiktorwojcikowski opened this issue Nov 10, 2015 · 6 comments

Comments

@wiktorwojcikowski
Copy link

Applying locking.0004_auto_20150915_1411...

django.db.utils.ProgrammingError: column "id" cannot be cast automatically to type uuid
HINT: Specify a USING expression to perform the conversion.

@wiktorwojcikowski
Copy link
Author

I have recreate table with id field as UUIDField (by changing it in initial migration, and comment out migration 0004). Worked, but it still need a fix.

@nielsvanoch
Copy link
Member

Good catch. I'll update this (probably some time this weekend).

@nielsvanoch
Copy link
Member

I've pushed a version to https://github.com/vikingco/django-db-locking/compare/issue-24/uuid-migration. It works in the setups I've tried, but could you validate it on yours as well @wiktorwojcikowski? And if you should still have issues, what database (version) are you using?

@wiktorwojcikowski
Copy link
Author

Works!
There are some warnnigs about thsi dates without timezones:
https://github.com/vikingco/django-db-locking/blob/issue-24/uuid-migration/locking/migrations/0003_optimize_queries.py#L19

RuntimeWarning: DateTimeField NonBlockingLock.renewed_on received a naive datetime (2015-09-07 03:32:18.056000) while time zone support is active.

But it works anyway. Thanks for fixing.
(I'm using postgresql 9.1)

@nielsvanoch
Copy link
Member

Ok, great! I'll bump the version.

@wiktorwojcikowski
Copy link
Author

Ok, locally worked but I test on dev server now and if there are any locks at DB, it throws "Duplicate entry" error, because all default uuids are same. I clear db and it pass, but it means it's still not perfect.

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

No branches or pull requests

2 participants