hackforla / peopledepot

A project to setup a datastore for people and projects at HackforLA. The link below takes you to the code documentation
https://hackforla.github.io/peopledepot/
GNU General Public License v2.0
5 stars 24 forks source link

Set up django-linear-migrations #217

Closed fyliu closed 8 months ago

fyliu commented 8 months ago

Fixes #215

What changes did you make?

Why did you make the changes (we will use this info to test)?

Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)

Steps to show it working

The change doesn't do anything, so I created an example to demonstrate it working using main and an open PR #216. That PR will need to add the max_migration.txt file for this to work. After that, that file will automatically be updated for any code based on main.

# add fang's fork as a remote
git remote add fang https://github.com/fyliu/peopledepot.git

# fetch from remote
git fetch fang

# delete the db volume
docker-compose down -v

# Checkout the dlm-1-main branch
git checkout fang/dlm-1-main

# run buildrun.sh
./scripts/buildrun.sh

# checkout the dlm-2-feature-branch
git checkout fang/dlm-2-feature-branch

# create a review branch
git checkout -b review

# run git rebase dlm-1-main
# I have rerere enabled in git and it was interfering with django-linear-migrations
git -c rerere.enabled=false rebase fang/dlm-1-main

# run rebase_migration to fix the conflict
docker-compose exec web python manage.py rebase_migration core

At this point, the conflicting migration file should be successfully renamed and the references updated. The only thing left to do is to add the changes and finish the rebase.

git add .
git rebase --continue
fyliu commented 8 months ago

Reopening to test board automation