Skip to content

Commit 2636c59

Browse files
authored
feat: stop supporting pre-tzaware migration database dumps. (ietf-tools#4782)
* feat: stop supporting pre-tzaware migration database dumps. * chore: remove unnecessary env variable
1 parent cb2f4af commit 2636c59

6 files changed

Lines changed: 5 additions & 65 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ jobs:
150150
run: |
151151
echo "Running checks..."
152152
./ietf/manage.py check
153-
./ietf/manage.py migrate || true
154-
echo "USE_TZ = True" >> ./ietf/settings_local.py
155153
./ietf/manage.py migrate
156154
echo "Validating migrations..."
157155
if ! ( ietf/manage.py makemigrations --dry-run --check --verbosity 3 ) ; then

.github/workflows/ci-run-tests.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ jobs:
4545
run: |
4646
echo "Running checks..."
4747
./ietf/manage.py check
48-
echo "Running migrations with USE_TZ=False..."
49-
./ietf/manage.py migrate || true
50-
echo "USE_TZ = True" >> ./ietf/settings_local.py
51-
echo "Running migrations with USE_TZ=True..."
5248
./ietf/manage.py migrate
5349
echo "Validating migrations..."
5450
if ! ( ietf/manage.py makemigrations --dry-run --check --verbosity 3 ) ; then

dev/deploy-to-container/start.sh

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,9 @@ echo "Running Datatracker checks..."
1111
./ietf/manage.py check
1212

1313
# Migrate, adjusting to what the current state of the underlying database might be:
14-
WORKSPACEDIR=.
15-
if ietf/manage.py showmigrations | grep "\[ \] 0003_pause_to_change_use_tz"; then
16-
if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then
17-
cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = False/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py
18-
else
19-
echo "USE_TZ = False" >> $WORKSPACEDIR/ietf/settings_local.py
20-
fi
21-
echo "Running Datatracker migrations with USE_TZ = False..."
22-
# This is expected to exit non-zero at the pause
23-
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local || true
24-
cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py
25-
echo "Running Datatracker migrations with USE_TZ = True..."
26-
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local
2714

28-
else
29-
if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then
30-
cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py
31-
else
32-
echo "USE_TZ = True" >> $WORKSPACEDIR/ietf/settings_local.py
33-
echo "Running Datatracker migrations..."
34-
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local
35-
fi
36-
fi
15+
echo "Running Datatracker migrations..."
16+
/usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local
3717

3818
echo "Starting Datatracker..."
3919
./ietf/manage.py runserver 0.0.0.0:8000 --settings=settings_local

dev/diff/prepare.sh

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,5 @@ chmod +x ./docker/scripts/app-create-dirs.sh
1414
./docker/scripts/app-create-dirs.sh
1515

1616
./ietf/manage.py check
17-
if ./ietf/manage.py showmigrations | grep "\[ \] 0003_pause_to_change_use_tz"; then
18-
if grep "USE_TZ" ./ietf/settings_local.py; then
19-
cat ./ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = False/' > /tmp/settings_local.py && mv /tmp/settings_local.py ./ietf/settings_local.py
20-
else
21-
echo "USE_TZ = False" >> ./ietf/settings_local.py
22-
fi
23-
# This is expected to exit non-zero at the pause
24-
/usr/local/bin/python ./ietf/manage.py migrate || true
25-
cat ./ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py ./ietf/settings_local.py
26-
/usr/local/bin/python ./ietf/manage.py migrate
17+
./ietf/manage.py migrate
2718

28-
else
29-
if grep "USE_TZ" ./ietf/settings_local.py; then
30-
cat ./ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py ./ietf/settings_local.py
31-
else
32-
echo "USE_TZ = True" >> ./ietf/settings_local.py
33-
/usr/local/bin/python ./ietf/manage.py migrate
34-
fi
35-
fi

docker/scripts/app-init.sh

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,25 +103,8 @@ echo "Running initial checks..."
103103

104104
# Migrate, adjusting to what the current state of the underlying database might be:
105105

106-
if ietf/manage.py showmigrations | grep "\[ \] 0003_pause_to_change_use_tz"; then
107-
if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then
108-
cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = False/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py
109-
else
110-
echo "USE_TZ = False" >> $WORKSPACEDIR/ietf/settings_local.py
111-
fi
112-
# This is expected to exit non-zero at the pause
113-
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local || true
114-
cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py
115-
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local
106+
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local
116107

117-
else
118-
if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then
119-
cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py
120-
else
121-
echo "USE_TZ = True" >> $WORKSPACEDIR/ietf/settings_local.py
122-
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local
123-
fi
124-
fi
125108

126109
echo "-----------------------------------------------------------------"
127110
echo "Done!"

ietf/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
# to load the internationalization machinery.
115115
USE_I18N = False
116116

117-
USE_TZ = False
117+
USE_TZ = True
118118

119119
if SERVER_MODE == 'production':
120120
MEDIA_ROOT = '/a/www/www6s/lib/dt/media/'

0 commit comments

Comments
 (0)