{"id":21817377,"url":"https://github.com/lorinkoz/django-unmigrate","last_synced_at":"2025-10-14T22:35:35.455Z","repository":{"id":41904658,"uuid":"259794642","full_name":"lorinkoz/django-unmigrate","owner":"lorinkoz","description":"Smart reversion of Django migrations based on Git diff","archived":false,"fork":false,"pushed_at":"2023-05-09T22:15:55.000Z","size":170,"stargazers_count":76,"open_issues_count":4,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-19T19:49:45.622Z","etag":null,"topics":["django","git","migrations","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lorinkoz.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-29T01:34:06.000Z","updated_at":"2025-05-18T09:47:40.000Z","dependencies_parsed_at":"2024-11-27T15:45:39.877Z","dependency_job_id":"3ce5ef64-8d69-45ab-a845-6d5bbedf4c73","html_url":"https://github.com/lorinkoz/django-unmigrate","commit_stats":{"total_commits":96,"total_committers":7,"mean_commits":"13.714285714285714","dds":0.15625,"last_synced_commit":"2acffe70abcf9f2842df4b0a8c169d8eecbfb10b"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/lorinkoz/django-unmigrate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorinkoz%2Fdjango-unmigrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorinkoz%2Fdjango-unmigrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorinkoz%2Fdjango-unmigrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorinkoz%2Fdjango-unmigrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lorinkoz","download_url":"https://codeload.github.com/lorinkoz/django-unmigrate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorinkoz%2Fdjango-unmigrate/sbom","scorecard":{"id":599284,"data":{"date":"2025-08-11","repo":{"name":"github.com/lorinkoz/django-unmigrate","commit":"2acffe70abcf9f2842df4b0a8c169d8eecbfb10b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/code.yaml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/lorinkoz/django-unmigrate/code.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/code.yaml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/lorinkoz/django-unmigrate/code.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/code.yaml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/lorinkoz/django-unmigrate/code.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yaml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/lorinkoz/django-unmigrate/deploy.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/lorinkoz/django-unmigrate/deploy.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/lorinkoz/django-unmigrate/deploy.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/deploy.yaml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/lorinkoz/django-unmigrate/deploy.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/linters.yaml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/lorinkoz/django-unmigrate/linters.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/linters.yaml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/lorinkoz/django-unmigrate/linters.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/linters.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/lorinkoz/django-unmigrate/linters.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/linters.yaml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/lorinkoz/django-unmigrate/linters.yaml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/code.yaml:40","Warn: pipCommand not pinned by hash: .github/workflows/deploy.yaml:23","Warn: pipCommand not pinned by hash: .github/workflows/linters.yaml:20","Info:   0 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/code.yaml:1","Warn: no topLevel permission defined: .github/workflows/deploy.yaml:1","Warn: no topLevel permission defined: .github/workflows/linters.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"19 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2023-13 / GHSA-2hrw-hx67-34x6","Warn: Project is vulnerable to: PYSEC-2023-225 / GHSA-7h4p-27mh-hmrw","Warn: Project is vulnerable to: GHSA-7xr5-9hcq-chf9","Warn: Project is vulnerable to: PYSEC-2023-226 / GHSA-h8gc-pgj2-vjm3","Warn: Project is vulnerable to: PYSEC-2023-100 / GHSA-jh3w-4vvf-mjgr","Warn: Project is vulnerable to: PYSEC-2023-222 / GHSA-qmf9-6jqf-j8fq","Warn: Project is vulnerable to: PYSEC-2023-61 / GHSA-r3xc-prgr-mg9p","Warn: Project is vulnerable to: GHSA-rrqc-c2jx-6jgv","Warn: Project is vulnerable to: PYSEC-2024-47 / GHSA-vm8q-m57g-pff3","Warn: Project is vulnerable to: PYSEC-2024-28 / GHSA-xxj9-f6rv-m3x4","Warn: Project is vulnerable to: PYSEC-2024-4 / GHSA-2mqj-m65w-jghx","Warn: Project is vulnerable to: PYSEC-2023-165 / GHSA-cwvm-v4w8-q58c","Warn: Project is vulnerable to: PYSEC-2022-42992 / GHSA-hcpj-qp55-gfph","Warn: Project is vulnerable to: PYSEC-2023-137 / GHSA-pr76-5cm5-w9cj","Warn: Project is vulnerable to: PYSEC-2023-161 / GHSA-wfm5-v35h-vwf4","Warn: Project is vulnerable to: GHSA-2m57-hf25-phgg","Warn: Project is vulnerable to: PYSEC-2023-87 / GHSA-rrm6-wvj7-cwh2","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T23:57:54.452Z","repository_id":41904658,"created_at":"2025-08-20T23:57:54.452Z","updated_at":"2025-08-20T23:57:54.452Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279021784,"owners_count":26087056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","git","migrations","python"],"created_at":"2024-11-27T15:45:33.784Z","updated_at":"2025-10-14T22:35:35.434Z","avatar_url":"https://github.com/lorinkoz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"django-unmigrate\n================\n\n.. image:: https://img.shields.io/badge/packaging-poetry-purple.svg\n    :alt: Packaging: poetry\n    :target: https://github.com/sdispater/poetry\n\n.. image:: https://img.shields.io/badge/code%20style-black-black.svg\n    :alt: Code style: black\n    :target: https://github.com/ambv/black\n\n.. image:: https://github.com/lorinkoz/django-unmigrate/workflows/code/badge.svg\n    :alt: Build status\n    :target: https://github.com/lorinkoz/django-unmigrate/actions\n\n.. image:: https://coveralls.io/repos/github/lorinkoz/django-unmigrate/badge.svg?branch=master\n    :alt: Code coverage\n    :target: https://coveralls.io/github/lorinkoz/django-unmigrate?branch=master\n\n.. image:: https://badge.fury.io/py/django-unmigrate.svg\n    :alt: PyPi version\n    :target: http://badge.fury.io/py/django-unmigrate\n\n.. image:: https://pepy.tech/badge/django-unmigrate/month\n    :alt: Downloads\n    :target: https://pepy.tech/project/django-unmigrate/\n\n|\n\nIf you are in a complex Django project, sometimes you will find yourself switching\nbetween multiple branches, some of which can add a number of database migrations.\nBefore switching back to ``master`` you will have to unapply all migrations that\nare specific to the current branch. In order to unapply these, you will have to\nenter the migration that comes right before the first migration of the current\nbranch. If two or more apps are involved, you will have to do that for each one\nof them.\n\nIf you leave your migration names unchanged, inferring the name of the right\nmigration to target is not too difficult, because they are prefixed by default\nwith a sequential number. Django also helps, being smart enough to let you use\nan unambiguous prefix of any migration name. Add a merge migration and the\nnumbers will no longer be so obvious. Or if you have renamed your migration\nfiles to drop the sequential numbers you will have to do the search manually.\n\nWith ``django-unmigrate`` you can speed up the process.\n\nUsage\n-----\n\nAdd ``django_unmigrate`` to your ``INSTALLED_APPS``. This is required to make\nthe ``unmigrate`` management command available.\n\nThen, while standing on any branch, you will be able to use::\n\n    python manage.py unmigrate master\n\nOr if it's going to be ``master`` anyways, this will suffice::\n\n    python manage.py unmigrate\n\nAnd that's it!\n\nA little deeper\n---------------\n\nOk, you can do more than that.\n\nDo you need to unapply your migrations from the same branch, a few commits\nbehind? Here's how::\n\n    python manage.py unmigrate HEAD~12\n    python manage.py unmigrate b13553d\n    python manage.py unmigrate v1.33.7\n\nOr if you only want to see the target migrations, do::\n\n    python manage.py unmigrate --dry-run\n\nFinally, if you just want to play with the app with no actual modifications in\nthe database, go ahead and unapply your migrations with ``fake``. Just don't\nforget to apply them again at the end::\n\n    python manage.py unmigrate --fake\n    python manage.py migrate --fake\n\nContributing\n------------\n\n- Join the discussion at https://github.com/lorinkoz/django-unmigrate/discussions.\n- PRs are welcome! If you have questions or comments, please use the link\n  above.\n- To run the test suite run ``make`` or ``make coverage``. The tests for this\n  project live inside a small django project called ``dunm_sandbox``. Beware!\n  This package uses Git to function, therefore, the tests expect a number of\n  commit hashes inside this repository to be present and remain stable in order\n  to function. See `this meta file`_ for further details.\n\n.. _this meta file: https://github.com/lorinkoz/django-unmigrate/blob/master/dunm_sandbox/meta.py\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florinkoz%2Fdjango-unmigrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Florinkoz%2Fdjango-unmigrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florinkoz%2Fdjango-unmigrate/lists"}