Changes between Version 17 and Version 18 of MultipleColumnPrimaryKeys


Ignore:
Timestamp:
May 28, 2012, 7:57:23 PM (12 years ago)
Author:
Ben Finney
Comment:

explain the problem to be solved (not merely a legacy concern)

Legend:

Unmodified
Added
Removed
Modified
  • MultipleColumnPrimaryKeys

    v17 v18  
    11= Multi-Column Primary Key support =
    22
    3 Currently Django models only support single column primary keys.  Support for multi-column primary keys would allow Django to better integrate with legacy databases (whose schema cannot be changed and have multi-column primary keys).  There are a lot of details to get right here, but done right, it would allow for more flexibility in data modeling.
     3Relational database designs use a set of columns as the primary key for a table. When this set includes more than one column, it is known as a “composite” or “compound” primary key. (For more on the terminology, here is an [http://www.agiledata.org/essays/keys.html article discussing database keys]).
     4
     5Currently Django models only support single column primary keys, denying many designs where the natural primary key of a table is multiple columns. Django currently can't work with these schemas; they must instead introduce a redundant single-column key (a “surrogate” key), forcing applications to make arbitrary and otherwise-unnecessary choices about which key to use for the table in any given instance.
     6
     7This page discusses how to have Django support these composite primary keys. There are a lot of details to get right here, but done right, it would allow for more flexibility and potential simplicity in data modeling.
    48
    59= Current Status =
Back to Top