Ticket #36632: steps.sh

File steps.sh, 865 bytes (added by Michael Herrmann, 3 hours ago)
Line 
1#!/bin/bash
2
3set -e
4
5# Clean up a previous invocation:
6rm -rf mysite
7
8python3 -m venv venv
9source venv/bin/activate
10
11# Use Django 4 to generate migrations for models.py files with index_together.
12pip install -U 'django==4.2.24'
13
14django-admin startproject mysite
15cd mysite
16
17python manage.py startapp polls
18echo "INSTALLED_APPS.append('polls')" >> mysite/settings.py
19
20cp ../models_1.py polls/models.py
21python manage.py makemigrations
22
23cp ../models_2.py polls/models.py
24python manage.py makemigrations
25
26cp ../models_3.py polls/models.py
27python manage.py makemigrations
28
29pip install django==5.2.6
30
31# `migrate` now fails on Django 5 with the following error:
32# ValueError: Found wrong number (0) of indexes for polls_mymodel(a, b).
33# It does not fail with Django 4. To see this, comment out the django==5 line
34# above and re-run the script.
35python manage.py migrate
Back to Top