Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9124415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:34:00+00:00 2026-06-17T06:34:00+00:00

Suppose I have this model which is associated with south: class MyModel(models.Model): field_a =

  • 0

Suppose I have this model which is associated with south:

class MyModel(models.Model):
    field_a = models.CharField(max_length=30)
    field_b = models.CharField(max_length=30)

Now later on I want to add one more field so I created that field between field_a and field_b now my model looks like:

class MyModel(models.Model):
    field_a = models.CharField(max_length=30)
    field_c = models.CharField(max_length=30)
    field_b = models.CharField(max_length=30)

Then I migrated the changes, when checking the table structure in MySQL the field_c is created at the end of all fields. How can I tell south to maintain the fields order e.g. insert after field_a.

In MySQL we can insert the new field before or after any existing field. Is it possible to do that in south?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:34:02+00:00Added an answer on June 17, 2026 at 6:34 am

    I do not believe that it is not possible to force the order of field creation in MySQL when using Django (or South). New fields will always be appended to the end of the table definition.

    However: The order of the columns should be irrelevant to you. Read on…

    If you’re writing SQL queries against your database, it is bad form to do select * and rely on the field ordering of the table. Instead you should specify which fields you want to select, and the order in which you want them reported. This makes the underlying tables’ field-ordering unimportant.

    Additionally, if anyone in your organisation is currently writing reports which use select *: by inserting new columns between others you could easily break reports that use field position (rather than field name), as the indexing of the columns will change.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

suppose I have this model: class PhotoAlbum(models.Model): title = models.CharField(max_length=128) author = models.CharField(max_length=128) class
Suppose I have this model: class PhotoAlbum(models.Model): title = models.CharField(max_length=128) author = models.CharField(max_length=128) class
Suppose I have something like this in my models.py: class Hipster(models.Model): name = CharField(max_length=50)
Suppose I have a Book model, which contains many Page models. The routing for
Suppose I have this model: public class ViewModel { [Required] public string UserInput {
Suppose I have a domain model like this: public class MyDomainEntity { public double
Suppose I have this class: class MyClass(object): def uiFunc(self, MainWindow): self.attr1 = foo self.attr2
Suppose I have this feature branch foo. Now I want to merge it back
Suppose I have this html markup: <div id=wrapper> <pre class=highlight> $(function(){ // hide all
Suppose we have 2 classes, Child, and the class from which it inherits, Parent.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.