Last active
August 16, 2023 15:38
-
-
Save dillonhafer/7f07e8571ce998bfe79fed9392fd5e38 to your computer and use it in GitHub Desktop.
Tern diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function terndiff() { | |
temp_db_name="tern_dev_$(date +%s)" | |
dropdb $temp_db_name 2>/dev/null | |
createdb $temp_db_name | |
PGDATABASE=$temp_db_name tern migrate >/dev/null | |
expected_structure=$(PGDATABASE=$temp_db_name pg_dump -s) | |
dropdb $temp_db_name | |
current_structure=$(pg_dump -s) | |
delta <(printf '%s\n' "$current_structure") <(printf '%s\n' "$expected_structure") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment