Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions migrate-fixture.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### Example usage
# WARNING! Deletes your sqlite database
#
# `sh migrate-fixture.sh refactor/date-attribute stregsystem/fixtures/testdata.json`
# This will load the specified fixture on current `next` branch,
# then it switches to the specified branch, and migrates the database,
# then it dumps the database to the same file.
###

# Setup load current test data
rm db.sqlite3.bak
mv db.sqlite3 db.sqlite3.bak
git switch next
python manage.py migrate
python manage.py loaddata $2

# Migrate test data
git switch $1
python manage.py migrate
python manage.py dumpdata | tail -n +2 | python -m json.tool > $2