-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collapse DB migrations that have already been released (pre-ATCv6) #6065
Conversation
QUOTE_IDENT(table_name) | ||
); | ||
END IF; | ||
IF table_name = 'topology' THEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Topology index is incorrect, see #6066
QUOTE_IDENT(table_name), | ||
QUOTE_IDENT(table_name) | ||
); | ||
ELSIF table_name = 'phys_location' THEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phys_location index has a typo, see #6066
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified that
create_tables.sql
can still be run twice, and- A DB dump with collapsed migrations has the same sha256 sum as a DB dump from
apache/master
without collapsed migrations:(set -o errexit -o nounset; create_migrate_dump() {( create_migrate_dump() { trap 'echo "Error on line ${LINENO} of ${0}" >/dev/stderr; exit 1' ERR; set -o errexit -o nounset -o pipefail; { docker-entrypoint.sh postgres >/dev/stderr & sleep 10; <create_tables.sql psql; <create_tables.sql psql; for migration in migrations/*; do <"$migration" sed '/+goose Down/,$d' | psql; done; } >/dev/stderr; pg_dump | sed '/^-- Dumped/d'; }; docker run --rm -iw/db \ -v "$(pwd)/traffic_ops/app/db:/db" \ -e PGUSER=traffic_ops \ -e PGPASSWORD=twelve \ -e POSTGRES_USER=traffic_ops \ -e POSTGRES_PASSWORD=twelve \ postgres:13-alpine bash -c "$(type create_migrate_dump | tail -n+2); create_migrate_dump"; )}; for remote_branch in apache/master shamrickus/to/6.0-migration; do git fetch "${remote_branch/\/*}"; git checkout "${remote_branch}"; create_migrate_dump >"${remote_branch/\/*}.sql"; done; diff -u master.sql shamrickus.sql; openssl sha256 master.sql shamrickus.sql)
What does this PR (Pull Request) do?
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Run the
db/admin
tool on master and on this fork and compare the DB schema and data to ensure they are the same.I used
pg_dump
to fetch the data from the DBs anddiff
to compare the output.The following criteria are ALL met by this PR
Additional Information
My diff: