Skip to content

Commit 8b2a120

Browse files
committed
fix(stack/end-to-end-security): Skip DB restore if the DB exists
Otherwise it breaks with: ``` ERROR [flask_migrate] Error: Requested revision 17fcea065655 overlaps with other requested revisions b7851ee5522f ``` The latter revision being the one that exists in the uploaded dump.
1 parent 2f5212f commit 8b2a120

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stacks/end-to-end-security/superset.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ spec:
4646
- bash
4747
- -c
4848
- |
49+
if psql --host postgresql-superset --user postgres --csv -c "SELECT datname FROM pg_database where datname = 'superset' limit 1" | grep -q superset; then
50+
# The flask app will do any necesary migrations.
51+
echo "Skip restoring the DB as it alredy exists to already be there"
52+
exit 0
53+
fi
4954
psql --host postgresql-superset --user postgres < /dump/postgres_superset_dump.sql
5055
env:
5156
- name: PGPASSWORD

0 commit comments

Comments
 (0)