Insert the model field in the middle of existing one in Django -
say i'm trying insert new char field called tag, , want @ middle of existing table.
in django when add field , make migration, add new field end of sql table.
i can't edit in migration file either since adding 1 field:
operations = [ migrations.addfield( model_name='chat', name='tags', field=models.charfield(blank=true, max_length=100, null=true), )
is there anyway can customize order in django? or have go sql manually.
no, there's no way insert column between other columns without creating new tables. couldn't figure out reason have columns(model fields) in particular order, doesn't make sense. in fact, doubt there's sql statement directly reorder column sequence database schema.
Comments
Post a Comment