# Commiting Django migration files to version control.

**URL:** <https://forum.djangoproject.com/t/commiting-django-migration-files-to-version-control/9082>\
**Category:** Using Django\
**Created:** [August 4, 2021, 8:22am UTC](https://forum.djangoproject.com/t/commiting-django-migration-files-to-version-control/9082 "2021-08-04T08:22:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ultra-Instinct-05](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/ultra-instinct-05/32/3267_2.png) [@Ultra-Instinct-05](https://forum.djangoproject.com/u/Ultra-Instinct-05)\
**Post date:** [August 4, 2021, 8:22am UTC](https://forum.djangoproject.com/t/commiting-django-migration-files-to-version-control/9082/1 "2021-08-04T08:22:49Z")

</div>

This is more of a question than asking for some technical help, but after researching for some posts in SO, people usually do `makemigrations` in development environment, commit the migration files to production and then `migrate` to apply the migrations to the database.

My question is, doesn’t that increase the repo size. With each version of the product, you might have a lot of migration files and that could (?) potentially bloat the repo.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [August 4, 2021, 12:55pm UTC](https://forum.djangoproject.com/t/commiting-django-migration-files-to-version-control/9082/2 "2021-08-04T12:55:44Z")

</div>

Two quick thoughts on this:

- You only need to keep the migration files if you’re ever in a situation where you need to upgrade a system and need to keep the existing data. If you’re always deploying new instances and creating new databases, they’re not necessary.

- The migration files are tiny compared to everything else you probably have in the repo. It’s not worth worrying about.

---

<div class="post-metadata">

**Author:** ![CodenameTim](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/codenametim/32/31507_2.png) [@CodenameTim](https://forum.djangoproject.com/u/CodenameTim)\
**Post date:** [August 4, 2021, 7:01pm UTC](https://forum.djangoproject.com/t/commiting-django-migration-files-to-version-control/9082/3 "2021-08-04T19:01:44Z")

</div>

In addition to Ken’s great points, if you do find an app has too many migrations, Django does support squashing migrations. You can read more on the [`squashmigrations` command here](https://docs.djangoproject.com/en/3.2/topics/migrations/#squashing-migrations).

---

<div class="post-metadata">

**Author:** ![Ultra-Instinct-05](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/ultra-instinct-05/32/3267_2.png) [@Ultra-Instinct-05](https://forum.djangoproject.com/u/Ultra-Instinct-05)\
**Post date:** [August 5, 2021, 4:01am UTC](https://forum.djangoproject.com/t/commiting-django-migration-files-to-version-control/9082/4 "2021-08-05T04:01:22Z")

</div>

Awesome ! Django has you covered all the way.
