Adding a field next to specific column by migrations ?

I made a migrations by python manage.py makemigrations and a file 00xx_yyyyy was created.
It contains migration.AddField( ... ), but python manage.py migrate add the column after current columns. It’s position is last. I want to insert the column after the specific column.

For example:

mysql> desc point ;
+------------+--------------+------+-----+---------+----------------+
| Field      | Type         | Null | Key | Default | Extra          |
+------------+--------------+------+-----+---------+----------------+
| id         | bigint       | NO   | PRI | NULL    | auto_increment |
| name       | varchar(100) | NO   |     | NULL    |                |
| created_at | datetime(6)  | NO   |     | NULL    |                |
| updated_at | datetime(6)  | NO   |     | NULL    |                |
+------------+--------------+------+-----+---------+----------------+

the_column after name

mysql> desc point ;
+------------+--------------+------+-----+---------+----------------+
| Field      | Type         | Null | Key | Default | Extra          |
+------------+--------------+------+-----+---------+----------------+
| id         | bigint       | NO   | PRI | NULL    | auto_increment |
| name       | varchar(100) | NO   |     | NULL    |                |
| the_column | int          | YES  |     | NULL    |                |
| created_at | datetime(6)  | NO   |     | NULL    |                |
| updated_at | datetime(6)  | NO   |     | NULL    |                |
+------------+--------------+------+-----+---------+----------------+


How do I do like that via django migrations?

Welcome @tttreal !

You would need to manually create the migration yourself with the appropriate migration directives and SQL statements. The makemigrations command is not going to do that for you.

See

for more details on this.

Okay I see.
Thank you!!!
I will try like you mentioned.