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-1.0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

django_migration_cleaner-1.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_migration_cleaner-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a889d8fe92a1a0d8d86c0510231709950db409e7c928a5c8e1da8449c145cd6e
MD5 78449254e3f32687302b8cab2da9444e
BLAKE2b-256 b46fad99d4aad0d56dc7eaeb979276979cb88a0664b8a8ceaf6a0f7a12f0a4d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_migration_cleaner-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 39dd6f3b85ececbff0b74de3d29ca8eb56417abc2c05ee5e6f2e448d291ba52a
MD5 77371dfd47673947241b565bcb948cca
BLAKE2b-256 947ceb0a4fb8d7036f1389c9335b4464b6ce8cf9f415f69a0f1700b270e9cc74

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