Skip to content

Commit 00264a4

Browse files
ci: ensure blobdbs exist for sandboxen
1 parent 37e3ffc commit 00264a4

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

dev/deploy-to-container/start.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ echo "Running Datatracker checks..."
3535

3636
# Migrate, adjusting to what the current state of the underlying database might be:
3737

38+
# On production, the blobdb tables are in a separate database. Manipulate migration
39+
# history to ensure that they're created for the sandbox environment that runs it
40+
# all from a single database.
41+
echo "Ensuring blobdb relations exist..."
42+
/usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local --fake blobdb zero
43+
if ! /usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local blobdb; then
44+
# If we are restarting a sandbox, the migration may already have run and re-running
45+
# it will fail. Assume that happened and fake it.
46+
/usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local --fake blobdb
47+
fi
48+
49+
# Now run the migrations for real
3850
echo "Running Datatracker migrations..."
3951
/usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local
4052

0 commit comments

Comments
 (0)