#31698 closed Cleanup/optimization (wontfix)
Remove DatabaseOperations.autoinc_sql()
Reported by: | Adam Johnson | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
This was added in 38b5d7f23d8f7a39646a9b298f10941a70585031 and added to the migrations schema editor in 924a89e135fe54bc7622aa6f03405211e75c06e9. It was only ever used for Oracle support. 924a89e135fe54bc7622aa6f03405211e75c06e9 reimplemented Oracle autoincrement keys without autoinc_sql
, so it has no use in Django core any more.
I checked two popular third party backends and they aren't using it:
Change History (6)
comment:1 by , 4 years ago
Description: | modified (diff) |
---|
comment:2 by , 4 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Summary: | Remove database backend Operations.autoinc_sql → Remove DatabaseOperations.autoinc_sql() |
comment:3 by , 4 years ago
Those packages are last touched 6 and 8 years ago, respectively. Neither is well documented and there are many database backend changes since the version they both support (1.4). I don't think it's worth stalling cleanup for them. Additionally, a custom database backend would be able to implement equivalent functionality in its own schema editor relatively easily.
comment:4 by , 4 years ago
At least django-firebird is still active and linked from our documentation. I suggested to remove it from our documentation since it hasn't had a release since Django 1.11 but that wasn't accepted.
I don't really care about the fate of this issue but I don't think the code is adding much maintenance burden to Django and if there are at least two databases that use this feature, it seems there could be others (I stopped my github code search after these two hits in as many minutes). It seems easier to update this logic (like adding 'SmallAutoField') once in Django, rather than requiring each backend to make that update (although firebird is currently copying enough code in its SchemaEditor that this argument doesn't apply).
I guess having that code in Django is at least helpful in the sense that it calls out "if your database has this behavior, do it here."
comment:5 by , 4 years ago
At least django-firebird is still active and linked from our documentation.
Ah right, it's in a new repo. THat still uses autoinc_sql
I don't really care about the fate of this issue but I don't think the code is adding much maintenance burden to Django
Fair, although I just don't like stuff accumulating.
I stopped my github code search after these two hits in as many minutes
Have you got any hints for github code search? I tried but all I found were copies of django in committed virtualenvs.
I found usage in django_hana and django-firebird so it may still be useful.