Skip to main content

A Django management command to delete migrations.

Project description

Django Migration Cleaner

Django Migration Cleaner is a Django management command that allows you to easily delete migration files for specified apps or for all apps within your Django project. This can be useful for cleaning up your project during development.

Features

  • Delete migration files for specified apps.
  • Delete migration files for all apps within the project.
  • Ensures built-in Django apps are not modified.

Installation

You can install Django Migration Cleaner via pip:

pip install django-migration-cleaner

Add django_migration_cleaner to your INSTALLED_APPS in your Django project's settings.py:

INSTALLED_APPS = [
    ...
    'django_migration_cleaner',
    ...
]

Usage

Delete Migrations for Specific Apps To delete migration files for specific apps, run the following command:

python manage.py delete_migrations app_name1 app_name2

Replace app_name1, app_name2, etc. with the names of the apps for which you want to delete the migration files.

Delete Migrations for All Apps

To delete migration files for all apps within your Django project, run the following command:

python manage.py delete_migrations --all

Example

python manage.py delete_migrations myapp anotherapp

This will delete all migration files for myapp and anotherapp, except for the init.py files in their migration directories.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
  • Steps to Contribute
  • Fork the repository.
  • Create your feature branch (git checkout -b feature/YourFeature).
  • Commit your changes (git commit -am 'Add some feature').
  • Push to the branch (git push origin feature/YourFeature).
  • Create a new Pull Request.
  • License

This project is licensed under the MIT License. See the LICENSE file for more details.

Acknowledgements

This project was inspired by the need to clean up migration files during Django project development.

Contact

For any questions or suggestions, feel free to open an issue or contact the project maintainer.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_migration_cleaner-0.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

django_migration_cleaner-0.0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file django_migration_cleaner-0.0.1.tar.gz.

File metadata

File hashes

Hashes for django_migration_cleaner-0.0.1.tar.gz
Algorithm Hash digest
SHA256 783f3d78f5ff00cd7b0d4b31ff7352ed2b1e9f78f7c60eaa6255fb8ad05bbc63
MD5 0487e7693ecbd2e1bf7d9874326a61d6
BLAKE2b-256 b62816c0d344a9e26f017049b0d88687de46d8dbfbe95132d030ece168b418c7

See more details on using hashes here.

File details

Details for the file django_migration_cleaner-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_migration_cleaner-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa1b22107a31f7d34fdd73b3819e516841d37b320ccb7d74d99a5bfb40c7754b
MD5 faa4f49720a4d78a373809ebbfa5f68b
BLAKE2b-256 376e47af8a9b946d50b2d38e411e5954247468585f611a4ec5a8ebe448ae3684

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page