%global _empty_manifest_terminate_build 0
Name: python-django-migration-fixer
Version: 1.3.6
Release: 1
Summary: Resolve migration errors
License: MIT license
URL: https://github.com/tj-django/django-migration-fixer
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/6a/d0/404df3679fcd43738dfa031798fa6b2d18fa4d734b27f04a2534e0e5b0b3/django-migration-fixer-1.3.6.tar.gz
BuildArch: noarch
Requires: python3-django
Requires: python3-GitPython
Requires: python3-typing-extensions
Requires: python3-bump2version
Requires: python3-readme-renderer[md]
Requires: python3-django
Requires: python3-GitPython
Requires: python3-typing-extensions
Requires: python3-bump2version
Requires: python3-readme-renderer[md]
Requires: python3-pytest
Requires: python3-pytest-django
Requires: python3-pytest-sugar
Requires: python3-pytest-mock
Requires: python3-pytest-git
Requires: python3-tox
Requires: python3-tox-gh-actions
Requires: python3-coverage
Requires: python3-pip-tools
Requires: python3-flake8
Requires: python3-yamllint
Requires: python3-isort
Requires: python3-black
Requires: python3-mypy
Requires: python3-mkautodoc
Requires: python3-mkdocs
Requires: python3-portray
Requires: python3-mkdocs-material-extensions
Requires: python3-pygments
Requires: python3-pymdown-extensions
Requires: python3-flake8
Requires: python3-yamllint
Requires: python3-isort
Requires: python3-black
Requires: python3-mypy
Requires: python3-pytest
Requires: python3-pytest-django
Requires: python3-bump2version
Requires: python3-pytest-sugar
Requires: python3-pytest-mock
Requires: python3-pytest-git
Requires: python3-tox
Requires: python3-tox-gh-actions
Requires: python3-coverage
Requires: python3-pip-tools
%description

[](https://www.codacy.com/gh/tj-django/django-migration-fixer/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=tj-django/django-migration-fixer\&utm_campaign=Badge_Coverage) [](https://codecov.io/gh/tj-django/django-migration-fixer)
[](https://lgtm.com/projects/g/tj-django/django-migration-fixer/alerts/) [](https://lgtm.com/projects/g/tj-django/django-migration-fixer/context:python) [](https://www.codacy.com/gh/tj-django/django-migration-fixer/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=tj-django/django-migration-fixer\&utm_campaign=Badge_Grade)
[](https://github.com/tj-django/django-migration-fixer/actions/workflows/test.yml) [](https://github.com/tj-django/django-migration-fixer/actions/workflows/deploy.yml) [](https://github.com/tj-django/django-migration-fixer/actions/workflows/lint.yml) [](https://pyup.io/repos/github/tj-django/django-migration-fixer/) [](https://github.com/psf/black)
[](https://pypi.python.org/pypi/django-migration-fixer)
[](https://pypi.python.org/pypi/django-migration-fixer) [](https://pypi.python.org/pypi/django-migration-fixer) [](https://pepy.tech/project/django-migration-fixer)
[](https://github.com/search?o=desc\&q=tj-django+django-migration-fixer+language%3AYAML\&s=\&type=Code)
# django-migration-fixer
Resolve django makemigrations `multiple leaf nodes in the migration graph` by ensuring that migration files and dependencies are always ordered regardless of remote changes, without having to run `python manage.py makemigrations --merge`.
## Table of Contents
* [Features](#features)
* [Installation](#installation)
* [Add `migration_fixer` to your INSTALLED\_APPS](#add-migration_fixer-to-your-installed_apps)
* [Usage](#usage)
* [Example](#example)
* [After merging the default branch](#after-merging-the-default-branch)
* [After running django-migration-fixer](#after-running-django-migration-fixer)
* [Assumptions](#assumptions)
* [Specifying a different default branch](#specifying-a-different-default-branch)
* [Setup using Github Actions](#setup-using-github-actions)
* [Inputs](#inputs)
* [Test Platforms](#test-platforms)
* [Found a Bug?](#found-a-bug)
## Features
* Resolve migration conflicts on Pull Request branches
* Resolve migration conflicts on the default branch **(NOT RECOMMENDED)**
## Installation
```bash
$ pip install django-migration-fixer
```
### Add `migration_fixer` to your INSTALLED\_APPS
```python
INSTALLED_APPS = [
...,
"migration_fixer",
...,
]
```
## Usage
Merge the changes from the default branch or the target branch of the pull request.
```bash
$ git checkout main # OR: develop/another parent feature branch
$ git pull
$ git checkout feature/xxxx
$ git merge main
```
Fix the migration conflicts
```bash
$ python manage.py makemigrations --fix
```
By default this uses `main` as the default branch
## Example
### After merging the default branch

### After running django-migration-fixer

## Assumptions
The final migration on the default branch would be used as the base for all subsequent migrations.
### Specifying a different default branch
Run:
```bash
$ python manage.py makemigrations -b master --fix
```
## Setup using Github Actions
> NOTE: :warning:
>
> * To get this action to work you'll need to install [django-migration-fixer](#installation) and update your `INSTALLED_APPS` setting.
### Inputs
| Input | type | required | default | description |
|:-------------:|:-----------:|:--------------:|:-----------------------------:|:--------------------------:|
| managepy-path | `string` | `true` | `./manage.py` | The location of manage.py. |
| default-branch | `string` | `false` | `${{ github.base_ref }}` | The default branch or
target branch of a Pull request. |
| force-update | `string` | `false` | | Force update the target branch
locally when git fetch fails. |
| skip-default-branch-update | `string` | `false` | | Skip pulling the latest
changes from the default branch. |
```yaml
name: Fix django migrations
on:
pull_request:
branches:
- main
jobs:
fix-migrations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6.x'
- name: Upgrade pip
run: |
pip install -U pip
- name: Install project dependencies
run: |
make install
- name: Run django-migration-fixer
uses: tj-django/django-migration-fixer@v1.3.6
with:
managepy-path: /path/to/manage.py
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v7.1
id: verify-changed-files
with:
files: |
/path/to/migrations
- name: Commit migration changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add /path/to/migrations
git commit -m "Updated migrations"
- name: Push migration changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
```
See: https://github.com/tj-django/django-clone for a working example.
## Test Platforms
* [`ubuntu-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
* [`macos-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
* [`windows-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
## Found a Bug?
To file a bug or submit a patch, please head over to [django-migration-fixer on github](https://github.com/tj-django/django-migration-fixer/issues).
If you feel generous and want to show some extra appreciation:
Support me with a :star:
[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
[buymeacoffee]: https://www.buymeacoffee.com/jackton1
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png
%package -n python3-django-migration-fixer
Summary: Resolve migration errors
Provides: python-django-migration-fixer
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-django-migration-fixer

[](https://www.codacy.com/gh/tj-django/django-migration-fixer/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=tj-django/django-migration-fixer\&utm_campaign=Badge_Coverage) [](https://codecov.io/gh/tj-django/django-migration-fixer)
[](https://lgtm.com/projects/g/tj-django/django-migration-fixer/alerts/) [](https://lgtm.com/projects/g/tj-django/django-migration-fixer/context:python) [](https://www.codacy.com/gh/tj-django/django-migration-fixer/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=tj-django/django-migration-fixer\&utm_campaign=Badge_Grade)
[](https://github.com/tj-django/django-migration-fixer/actions/workflows/test.yml) [](https://github.com/tj-django/django-migration-fixer/actions/workflows/deploy.yml) [](https://github.com/tj-django/django-migration-fixer/actions/workflows/lint.yml) [](https://pyup.io/repos/github/tj-django/django-migration-fixer/) [](https://github.com/psf/black)
[](https://pypi.python.org/pypi/django-migration-fixer)
[](https://pypi.python.org/pypi/django-migration-fixer) [](https://pypi.python.org/pypi/django-migration-fixer) [](https://pepy.tech/project/django-migration-fixer)
[](https://github.com/search?o=desc\&q=tj-django+django-migration-fixer+language%3AYAML\&s=\&type=Code)
# django-migration-fixer
Resolve django makemigrations `multiple leaf nodes in the migration graph` by ensuring that migration files and dependencies are always ordered regardless of remote changes, without having to run `python manage.py makemigrations --merge`.
## Table of Contents
* [Features](#features)
* [Installation](#installation)
* [Add `migration_fixer` to your INSTALLED\_APPS](#add-migration_fixer-to-your-installed_apps)
* [Usage](#usage)
* [Example](#example)
* [After merging the default branch](#after-merging-the-default-branch)
* [After running django-migration-fixer](#after-running-django-migration-fixer)
* [Assumptions](#assumptions)
* [Specifying a different default branch](#specifying-a-different-default-branch)
* [Setup using Github Actions](#setup-using-github-actions)
* [Inputs](#inputs)
* [Test Platforms](#test-platforms)
* [Found a Bug?](#found-a-bug)
## Features
* Resolve migration conflicts on Pull Request branches
* Resolve migration conflicts on the default branch **(NOT RECOMMENDED)**
## Installation
```bash
$ pip install django-migration-fixer
```
### Add `migration_fixer` to your INSTALLED\_APPS
```python
INSTALLED_APPS = [
...,
"migration_fixer",
...,
]
```
## Usage
Merge the changes from the default branch or the target branch of the pull request.
```bash
$ git checkout main # OR: develop/another parent feature branch
$ git pull
$ git checkout feature/xxxx
$ git merge main
```
Fix the migration conflicts
```bash
$ python manage.py makemigrations --fix
```
By default this uses `main` as the default branch
## Example
### After merging the default branch

### After running django-migration-fixer

## Assumptions
The final migration on the default branch would be used as the base for all subsequent migrations.
### Specifying a different default branch
Run:
```bash
$ python manage.py makemigrations -b master --fix
```
## Setup using Github Actions
> NOTE: :warning:
>
> * To get this action to work you'll need to install [django-migration-fixer](#installation) and update your `INSTALLED_APPS` setting.
### Inputs
| Input | type | required | default | description |
|:-------------:|:-----------:|:--------------:|:-----------------------------:|:--------------------------:|
| managepy-path | `string` | `true` | `./manage.py` | The location of manage.py. |
| default-branch | `string` | `false` | `${{ github.base_ref }}` | The default branch or
target branch of a Pull request. |
| force-update | `string` | `false` | | Force update the target branch
locally when git fetch fails. |
| skip-default-branch-update | `string` | `false` | | Skip pulling the latest
changes from the default branch. |
```yaml
name: Fix django migrations
on:
pull_request:
branches:
- main
jobs:
fix-migrations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6.x'
- name: Upgrade pip
run: |
pip install -U pip
- name: Install project dependencies
run: |
make install
- name: Run django-migration-fixer
uses: tj-django/django-migration-fixer@v1.3.6
with:
managepy-path: /path/to/manage.py
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v7.1
id: verify-changed-files
with:
files: |
/path/to/migrations
- name: Commit migration changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add /path/to/migrations
git commit -m "Updated migrations"
- name: Push migration changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
```
See: https://github.com/tj-django/django-clone for a working example.
## Test Platforms
* [`ubuntu-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
* [`macos-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
* [`windows-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
## Found a Bug?
To file a bug or submit a patch, please head over to [django-migration-fixer on github](https://github.com/tj-django/django-migration-fixer/issues).
If you feel generous and want to show some extra appreciation:
Support me with a :star:
[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
[buymeacoffee]: https://www.buymeacoffee.com/jackton1
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png
%package help
Summary: Development documents and examples for django-migration-fixer
Provides: python3-django-migration-fixer-doc
%description help

[](https://www.codacy.com/gh/tj-django/django-migration-fixer/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=tj-django/django-migration-fixer\&utm_campaign=Badge_Coverage) [](https://codecov.io/gh/tj-django/django-migration-fixer)
[](https://lgtm.com/projects/g/tj-django/django-migration-fixer/alerts/) [](https://lgtm.com/projects/g/tj-django/django-migration-fixer/context:python) [](https://www.codacy.com/gh/tj-django/django-migration-fixer/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=tj-django/django-migration-fixer\&utm_campaign=Badge_Grade)
[](https://github.com/tj-django/django-migration-fixer/actions/workflows/test.yml) [](https://github.com/tj-django/django-migration-fixer/actions/workflows/deploy.yml) [](https://github.com/tj-django/django-migration-fixer/actions/workflows/lint.yml) [](https://pyup.io/repos/github/tj-django/django-migration-fixer/) [](https://github.com/psf/black)
[](https://pypi.python.org/pypi/django-migration-fixer)
[](https://pypi.python.org/pypi/django-migration-fixer) [](https://pypi.python.org/pypi/django-migration-fixer) [](https://pepy.tech/project/django-migration-fixer)
[](https://github.com/search?o=desc\&q=tj-django+django-migration-fixer+language%3AYAML\&s=\&type=Code)
# django-migration-fixer
Resolve django makemigrations `multiple leaf nodes in the migration graph` by ensuring that migration files and dependencies are always ordered regardless of remote changes, without having to run `python manage.py makemigrations --merge`.
## Table of Contents
* [Features](#features)
* [Installation](#installation)
* [Add `migration_fixer` to your INSTALLED\_APPS](#add-migration_fixer-to-your-installed_apps)
* [Usage](#usage)
* [Example](#example)
* [After merging the default branch](#after-merging-the-default-branch)
* [After running django-migration-fixer](#after-running-django-migration-fixer)
* [Assumptions](#assumptions)
* [Specifying a different default branch](#specifying-a-different-default-branch)
* [Setup using Github Actions](#setup-using-github-actions)
* [Inputs](#inputs)
* [Test Platforms](#test-platforms)
* [Found a Bug?](#found-a-bug)
## Features
* Resolve migration conflicts on Pull Request branches
* Resolve migration conflicts on the default branch **(NOT RECOMMENDED)**
## Installation
```bash
$ pip install django-migration-fixer
```
### Add `migration_fixer` to your INSTALLED\_APPS
```python
INSTALLED_APPS = [
...,
"migration_fixer",
...,
]
```
## Usage
Merge the changes from the default branch or the target branch of the pull request.
```bash
$ git checkout main # OR: develop/another parent feature branch
$ git pull
$ git checkout feature/xxxx
$ git merge main
```
Fix the migration conflicts
```bash
$ python manage.py makemigrations --fix
```
By default this uses `main` as the default branch
## Example
### After merging the default branch

### After running django-migration-fixer

## Assumptions
The final migration on the default branch would be used as the base for all subsequent migrations.
### Specifying a different default branch
Run:
```bash
$ python manage.py makemigrations -b master --fix
```
## Setup using Github Actions
> NOTE: :warning:
>
> * To get this action to work you'll need to install [django-migration-fixer](#installation) and update your `INSTALLED_APPS` setting.
### Inputs
| Input | type | required | default | description |
|:-------------:|:-----------:|:--------------:|:-----------------------------:|:--------------------------:|
| managepy-path | `string` | `true` | `./manage.py` | The location of manage.py. |
| default-branch | `string` | `false` | `${{ github.base_ref }}` | The default branch or
target branch of a Pull request. |
| force-update | `string` | `false` | | Force update the target branch
locally when git fetch fails. |
| skip-default-branch-update | `string` | `false` | | Skip pulling the latest
changes from the default branch. |
```yaml
name: Fix django migrations
on:
pull_request:
branches:
- main
jobs:
fix-migrations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6.x'
- name: Upgrade pip
run: |
pip install -U pip
- name: Install project dependencies
run: |
make install
- name: Run django-migration-fixer
uses: tj-django/django-migration-fixer@v1.3.6
with:
managepy-path: /path/to/manage.py
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v7.1
id: verify-changed-files
with:
files: |
/path/to/migrations
- name: Commit migration changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add /path/to/migrations
git commit -m "Updated migrations"
- name: Push migration changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
```
See: https://github.com/tj-django/django-clone for a working example.
## Test Platforms
* [`ubuntu-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
* [`macos-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
* [`windows-*`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
## Found a Bug?
To file a bug or submit a patch, please head over to [django-migration-fixer on github](https://github.com/tj-django/django-migration-fixer/issues).
If you feel generous and want to show some extra appreciation:
Support me with a :star:
[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
[buymeacoffee]: https://www.buymeacoffee.com/jackton1
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png
%prep
%autosetup -n django-migration-fixer-1.3.6
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-django-migration-fixer -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue May 30 2023 Python_Bot - 1.3.6-1
- Package Spec generated