Remove original language field on migrations
See original GitHub issueLet’s say I have a model with a name
field and I want that to be translatable to, say, en
, nl
, es
. Currently when I run makemigrations
, 3 new fields are created in the migration (name_en
, name_nl
, name_es
). The name
field is also preserved, however. Assuming my default language is English, It is redundant to have both name
and name_en
in the database. Trying to manually remove the name
field in the migration is of course not a solution because future runs of makemigrations
will trigger the recreation of a migration to add it back.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Django Migrations removing field - Stack Overflow
The problem is that you added a comma to the fielda line when you added fieldb : fieldA = models.IntegerField(default=0),. You should remove...
Read more >Managing Migrations - EF Core - Microsoft Learn
In some extreme cases, it may be necessary to remove all migrations and start over. This can be easily done by deleting your...
Read more >Migrating from django-modeltranslation - Read the Docs
Run ./manage.py migrate to actually apply the generated migrations. This will remove the django-modeltranslation fields and their content from your database.
Read more >Migrations - Django documentation
Migrations are Django's way of propagating changes you make to your models (adding a field, deleting a model, etc.) into your database schema....
Read more >Database: Migrations - The PHP Framework For Web Artisans
Now, when you attempt to migrate your database and no other migrations have been executed, Laravel will execute first the SQL statements of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@arielpontes Did you find any solution?
Thank you for documenting the decision and maintaining the code! 🥇