Skip to content

Commit

Permalink
feat(IPVC-2264): rename schema rather than export and re-import
Browse files Browse the repository at this point in the history
  • Loading branch information
bsgiles73 committed Apr 12, 2024
1 parent 0d4d308 commit d5833c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 127 deletions.
116 changes: 0 additions & 116 deletions etc/scripts/backfill_gene_id.py

This file was deleted.

3 changes: 1 addition & 2 deletions etc/scripts/create-new-schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ pg_dump -U uta_admin -h localhost -d uta -n "$source_uta_v" | \
# create new schema
gzip -cdq $dumps_dir/"$source_uta_v".pgd.gz | \
sbin/pg-dump-schema-rename "$source_uta_v" "$dest_uta_v" | \
sbin/pg-dump-schema-rename "uta_1_1" "$dest_uta_v" | \
psql -U uta_admin -h localhost -d uta -aeE
psql -U uta_admin -h localhost -d uta -aeE
11 changes: 2 additions & 9 deletions misc/gene-update/upgrade-uta-schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,5 @@ python misc/gene-update/backfill_gene_id.py \
# run Alembic migrations to add constraints and update existing views
alembic -c etc/alembic.ini upgrade head

## Copy data into destination schema
# dump working schema
pg_dump -U uta_admin -h localhost -d uta -n "$working_uta_v" | \
gzip -c > "$dumps_dir/$working_uta_v".pgd.gz

# copy data into destination schema
gzip -cdq "$dumps_dir/$working_uta_v".pgd.gz | \
sbin/pg-dump-schema-rename "$working_uta_v" "$dest_uta_v" | \
psql -U uta_admin -h localhost -d uta -aeE
## Rename schema to destination schema name
psql -h localhost -U uta_admin -d uta -c "ALTER SCHEMA uta RENAME TO $dest_uta_v";

0 comments on commit d5833c4

Please sign in to comment.