django-extensions / django-extensions/django-extensions
sqldiff: Duration fields not handled properly and array type handlinghack very broken
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.8k
- Forks
- 1.2k
- Avg merge
- 3h 58m
- Merged PRs (30d)
- 1
Description
Ref:
I hit this because my model has a DurationField which has a db type of interval[] and so this test is triggered. The test subsequently bombs anyhow because of malformed piece of SQL. If you look at it it's passing table_name, a string in as the first parameter which becomes the value of the attrelid column in pg_attribute which is of type oid and not string.
The comment of course is indicative of the status of this piece of code and it asks some salient questions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in django_extensions/management/commands/sqldiff.py around line 1190, where the issue identifies the DurationField and array-type handling. Reproduce the failure with a model whose database type is interval[], then inspect the generated PostgreSQL query and its attrelid parameter. Done means sqldiff handles this field without malformed SQL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, postgresql, python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100