Ticket #524 (closed enhancement: invalid)
When creating a new table the fields are in reverse order
| Reported by: | KyleMac | Owned by: | andrew |
|---|---|---|---|
| Priority: | trivial | Milestone: | 0.7.3 |
| Component: | migrations | Version: | unknown |
| Keywords: | Cc: |
Description
May be pedantic, but when creating a new table the fields are created in the reverse order that they were specified. This means that when viewing a table in some kind of SQL manager you have to scroll all the way to the right to view the primary key.
This is the case with MySQL at least.
Attachments
Change History
comment:1 Changed 3 years ago by andrew
- Status changed from new to infoneeded
- Milestone set to 0.7.3
comment:2 Changed 3 years ago by KyleMac
- Status changed from infoneeded to assigned
It seems like some of my migrations were generated backwards. I thought maybe it was an inheritance issue but I can't recreate it. Going by the date of the migration then it was probably made with 0.7.1, but only by a couple of days so there's a good chance it was 0.7.
It could be SQLite related too, but I can't recreate it with that either.
comment:3 Changed 3 years ago by KyleMac
Actually looking at it they weren't reversed at all. Columns at the start and end were swapped but the rest in the middle were completely random.
comment:4 Changed 3 years ago by andrew
That's very odd. The bit which orders the field output has had OrderedDicts? in it for quite a while now, but it's possible we fixed something in 0.7.1 that was broken in 0.7 in that regard.
If you can't replicate it using a newer version, I'm inclined to close this ticket...

This certainly isn't the case on my install; fields are inserted in precisely the order they are in the migrations.
Are the columns in the correct order in your migrations? Which version of South are you using now / did you use to make the migrations?