File: delete_squashed_migrations.rst

package info (click to toggle)
python-django-extensions 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,820 kB
  • sloc: python: 18,601; javascript: 7,354; makefile: 108; xml: 17
file content (30 lines) | stat: -rw-r--r-- 1,078 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
delete_squashed_migrations
==========================

:synopsis: Deletes leftover migrations after squashing and converts squashed
           migration to a normal one.

Deletes leftover migrations after squashing and converts squashed migration to
a normal one by removing the replaces attribute. This automates the clean up
procedure outlined at the end of the `Django migration squashing
documentation`__. Modifies your source tree! Use with care!

__ MigrationSquashingDocs_

Example Usage
-------------

With *django-extensions* installed you cleanup squashed migrations using the
*delete_squashed_migrations* command::

  # Delete leftover migrations from the first squashed migration found in myapp
  $ ./manage.py delete_squashed_migrations myapp

  # As above but non-interactive
  $ ./manage.py --noinput delete_squashed_migrations myapp

  # Explicitly specify the squashed migration to clean up
  $ ./manage.py delete_squashed_migrations myapp 0001_squashed


.. _MigrationSquashingDocs: https://docs.djangoproject.com/en/dev/topics/migrations/#migration-squashing