Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#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 Adam Johnson)

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 Adam Johnson, 5 years ago

Description: modified (diff)

comment:2 by Tim Graham, 5 years ago

Resolution: wontfix
Status: newclosed
Summary: Remove database backend Operations.autoinc_sqlRemove DatabaseOperations.autoinc_sql()

I found usage in django_hana and django-firebird so it may still be useful.

comment:3 by Adam Johnson, 5 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 Tim Graham, 5 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 Adam Johnson, 5 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.

comment:6 by Tim Graham, 5 years ago

I browsed a few pages of this GitHub search.

Note: See TracTickets for help on using tickets.
Back to Top