#14286: Support for BigAutoField
---------------------------------------------------+------------------------
Reporter: hongrich | Owner: nobody
Status: new | Milestone:
Component: Database layer (models, ORM) | Version: 1.2
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Changes (by maaatt):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
In the meantime, it suffices to use a standard {{{AutoField}}} and hack
the database like so:
In the table in question, alter the field like so: {{{ALTER TABLE
[table_name] ALTER COLUMN [field_name] [data_type]}}}, where
{{{[data_type]}}} is one of the following:
MySQL: {{{bigint AUTO_INCREMENT}}} [[BR]]
Oracle: {{{NUMBER(19)}}} [[BR]]
PostgreSQL: {{{bigserial}}} [[BR]]
SQLite: {{{integer}}}
For every foreign key pointing to your field, you will also need to alter
the column, but with these data types:
MySQL: {{{bigint}}} [[BR]]
Oracle: {{{NUMBER(19)}}} [[BR]]
PostgreSQL: {{{bigint}}} [[BR]]
SQLite: {{{integer}}}
This is a pain, but you only need to do it when creating tables, once. On
the other hand, users shouldn't have to hack the database for such a
simple feature, in my opinion. It would be super-cool if 1.3 included a
fully-functional {{{BigAutoField}}}.
--
Ticket URL: <http://code.djangoproject.com/ticket/14286#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.