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
Built Distribution
File details
Details for the file django_migration_cleaner-1.0.3.tar.gz
.
File metadata
- Download URL: django_migration_cleaner-1.0.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c09c9c0e4fd51f3bbdf6d6b031e953e7eb958f21385714d2e8865692d66c581 |
|
MD5 | f6b624307cb2a282795e7abfdbfe4d64 |
|
BLAKE2b-256 | 5da0dd2b36b2d95937b4c66736e9291875683c247514ef7f8a662bb4e4ab932f |
File details
Details for the file django_migration_cleaner-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: django_migration_cleaner-1.0.3-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b2622f92b9a25f9c1ec3881e2fb9835c4f42f975a283d71ea116bc26ebca868 |
|
MD5 | 0baaef3f2c0b53c780d6cd285abe97f4 |
|
BLAKE2b-256 | 557570e425a3ab8c8406f1569bb4052015b59bda95b9482f6a017eec2beb715d |