Ticket #145 (closed defect: fixed)

Opened 7 years ago

Last modified 16 months ago

South creates fields in apparently random order

Reported by: justonia@… Owned by: andrew
Priority: minor Milestone: 0.6
Component: migrations Version: 0.6-pre
Keywords: Cc:


Using the built in syncdb, when a table is created the fields are created in the order they are specified in the model. In south this is not the case. I recognize that you can't maintain the correct order as fields are added/subtracted since some backends (at least PostgreSQL) don't support column reordering.

I would suggest that the initial migration should create the fields in the correct order. For tables that don't change this will mimic django's behavior, and for tables that do, at least some of the fields will be in the proper order (I am thinking specifically of an autoincrement primary key column, having to search each table display in the sql shell for the id column can be annoying when you are used to having it consistently on the far left).


preserve-field-ordering (853 bytes) - added by juan@… 6 years ago.
Patch to preserve ordering when outputting db.create_table

Change History

comment:1 Changed 7 years ago by andrew

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [247].

comment:2 Changed 7 years ago by andrew

  • Milestone set to 0.6

Changed 6 years ago by juan@…

Patch to preserve ordering when outputting db.create_table

comment:3 Changed 6 years ago by andrew

Fixed again in [bb529915d955].

Note: See TracTickets for help on using tickets.