Skip to content

Commit

Permalink
fix(stack/end-to-end-security): Skip DB restore if the DB exists
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
NickLarsenNZ committed Jan 16, 2025
1 parent 2f5212f commit 8b2a120
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stacks/end-to-end-security/superset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ spec:
- bash
- -c
- |
if psql --host postgresql-superset --user postgres --csv -c "SELECT datname FROM pg_database where datname = 'superset' limit 1" | grep -q superset; then
# The flask app will do any necesary migrations.
echo "Skip restoring the DB as it alredy exists to already be there"
exit 0
fi
psql --host postgresql-superset --user postgres < /dump/postgres_superset_dump.sql
env:
- name: PGPASSWORD
Expand Down

0 comments on commit 8b2a120

Please sign in to comment.