{"id":28485759,"url":"https://github.com/jdboisvert/django-migration-rollback","last_synced_at":"2026-04-02T18:48:57.209Z","repository":{"id":59430751,"uuid":"518255980","full_name":"jdboisvert/django-migration-rollback","owner":"jdboisvert","description":"A lightweight Django app to be able to migrate back to a previous migration or to migrate back to a migration in a specific branch in a git repository.","archived":false,"fork":false,"pushed_at":"2026-03-28T17:32:44.000Z","size":55,"stargazers_count":7,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-28T18:33:18.349Z","etag":null,"topics":["database","django","migration","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/jdboisvert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-07-27T00:23:03.000Z","updated_at":"2025-07-29T12:27:09.000Z","dependencies_parsed_at":"2023-11-09T00:35:54.603Z","dependency_job_id":"61df91f3-e11f-47f7-910c-8a05d4894f97","html_url":"https://github.com/jdboisvert/django-migration-rollback","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":0.09999999999999998,"last_synced_commit":"51e8dfdfa99d69cc289b96c1f3e93c3bd1887446"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/jdboisvert/django-migration-rollback","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdboisvert%2Fdjango-migration-rollback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdboisvert%2Fdjango-migration-rollback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdboisvert%2Fdjango-migration-rollback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdboisvert%2Fdjango-migration-rollback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdboisvert","download_url":"https://codeload.github.com/jdboisvert/django-migration-rollback/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdboisvert%2Fdjango-migration-rollback/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31313401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["database","django","migration","python"],"created_at":"2025-06-08T00:40:37.354Z","updated_at":"2026-04-02T18:48:57.201Z","avatar_url":"https://github.com/jdboisvert.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django Migration Rollback v1.1.0\nA Django package used to just make the `python manage.py migrate` a little easier for Django apps that commit their migrations and want a way to rollback to a previous migration without needing to check what the which one it is via `python manage.py showmigrations` or in the project's git repository.\n\n## Features\n\n- Roll back a single app or **all apps at once**\n- Roll back to the migration matching a specific git branch (`migraterollback`)\n- Roll back to the previously applied migration (`migrateprevious`)\n- `--fake` / `--fake-initial` support for marking migrations without running them\n- `--yes` / `-y` flag to skip confirmation prompts (useful in CI)\n- `--include-system-apps` to include Django's built-in apps in bulk rollbacks\n\n---\n\n## Commands\n\n### `migraterollback`\n\nRolls back a Django app's migrations to match the latest migration found on a given git branch.\n\n**Roll back a single app:**\n```\n❯ python manage.py migraterollback polls feature/really-cool-branch\nAttempting to rollback polls to latest migration on branch 'feature/really-cool-branch'\nOperations to perform:\n    Target specific migration: 0006_question5, from polls\nRunning migrations:\n    Rendering model states... DONE\n    Unapplying polls.0007_question6... OK\n```\n\n**Roll back all apps to match a branch (with confirmation prompt):**\n```\n❯ python manage.py migraterollback main\nThe following apps will be rolled back to the latest migration on branch 'main':\n  - polls\n  - accounts\n\nAre you sure you want to continue? [y/N] y\nRolling back all apps to latest migration on branch 'main'\n...\n```\n\n**Skip the confirmation prompt (useful in CI):**\n```\n❯ python manage.py migraterollback main --yes\n```\n\n**Mark migrations as applied without running them:**\n```\n❯ python manage.py migraterollback polls feature/really-cool-branch --fake\n```\n\n**Include Django system apps (auth, admin, etc.) in a bulk rollback:**\n```\n❯ python manage.py migraterollback main --include-system-apps\n```\n\u003e **Warning:** System apps have cross-app dependencies. Rolling them back can cause cascading effects. Use with caution.\n\n#### Arguments\n\n| Argument | Required | Default | Description |\n|---|---|---|---|\n| `app` | No | — | App to roll back. Omit to roll back all non-system apps. |\n| `branch` | No | `main` | Git branch to roll back to. |\n| `--fake` | No | `False` | Mark the target migration as applied without running SQL. |\n| `--fake-initial` | No | `False` | Fake-apply the initial migration if its tables already exist. |\n| `--yes` / `-y` | No | `False` | Skip the confirmation prompt when rolling back all apps. |\n| `--include-system-apps` | No | `False` | Include `auth`, `admin`, `contenttypes`, `sessions` in bulk rollback. |\n\n---\n\n### `migrateprevious`\n\nRolls back a Django app's migrations to the previously applied migration.\n\n**Roll back a single app:**\n```\n❯ python manage.py migrateprevious polls\nAttempting to rollback polls to previous migration\nOperations to perform:\n    Target specific migration: 0005_question4, from polls\nRunning migrations:\n    Rendering model states... DONE\n    Unapplying polls.0006_question5... OK\n```\n\n**Roll back all apps to their previous migration:**\n```\n❯ python manage.py migrateprevious\nThe following apps will be rolled back to their previous migration:\n  - polls\n  - accounts\n\nAre you sure you want to continue? [y/N] y\nRolling back all apps to their previous migration\n...\n```\n\n**Skip the confirmation prompt:**\n```\n❯ python manage.py migrateprevious --yes\n```\n\n**Mark migrations as applied without running them:**\n```\n❯ python manage.py migrateprevious polls --fake\n```\n\n#### Arguments\n\n| Argument | Required | Default | Description |\n|---|---|---|---|\n| `app` | No | — | App to roll back. Omit to roll back all non-system apps. |\n| `--fake` | No | `False` | Mark the target migration as applied without running SQL. |\n| `--fake-initial` | No | `False` | Fake-apply the initial migration if its tables already exist. |\n| `--yes` / `-y` | No | `False` | Skip the confirmation prompt when rolling back all apps. |\n| `--include-system-apps` | No | `False` | Include `auth`, `admin`, `contenttypes`, `sessions` in bulk rollback. |\n\n---\n\n## Installing\n### From PyPi\n```\npip install django-migration-rollback\n```\n\n### From GitHub\n```\npip install git+ssh://git@github.com/jdboisvert/django-migration-rollback\n```\n\n### Quick start\nAdd \"migration_rollback\" to your INSTALLED_APPS in the `settings.py` like this:\n```python\nINSTALLED_APPS = [\n    ...\n    'migration_rollback',\n]\n```\n\n---\n\n### Development\n\n## Getting started\n```bash\n# install pyenv (if necessary)\nbrew install pyenv pyenv-virtualenv\necho \"\"\"\nexport PYENV_VIRTUALENV_DISABLE_PROMPT=1\neval \"$(pyenv init --path)\"\neval \"$(pyenv init -)\"\neval \"$(pyenv virtualenv-init -)\"\n\"\"\" \u003e ~/.zshrc\nsource ~/.zshrc\n\n# create a virtualenv\npyenv install 3.11.0\npyenv virtualenv 3.11.0 django_migration_rollback\npyenv activate django_migration_rollback\n\n# install dependencies\npip install -U pip\npip install -r requirements.txt -r requirements_dev.txt\n```\n\n## Installing pre-commit hooks\n```bash\npre-commit install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdboisvert%2Fdjango-migration-rollback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdboisvert%2Fdjango-migration-rollback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdboisvert%2Fdjango-migration-rollback/lists"}