contentdb/utils/create_migration.sh

13 lines
399 B
Bash
Raw Permalink Normal View History

2023-12-16 00:49:54 +01:00
#!/bin/bash
2020-01-19 00:20:34 +01:00
# Create a database migration, and copy it back to the host.
set -e
. "${BASH_SOURCE%/*}/common.sh"
docker exec "$(container app)" sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db migrate"
docker exec -u root "$(container app)" sh -c "cp /home/cdb/migrations/versions/* /source/migrations/versions/"
2020-01-19 00:20:34 +01:00
USER=$(whoami)
sudo chown -R "$USER:$USER" migrations/versions