question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove original language field on migrations

See original GitHub issue

Let’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:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
MinaRogercommented, Dec 3, 2020

@arielpontes Did you find any solution?

1reaction
fdemmercommented, May 15, 2022

Thank you for documenting the decision and maintaining the code! 🥇

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found