Skip to content

Commit

Permalink
added sed lines back
Browse files Browse the repository at this point in the history
  • Loading branch information
rimashah25 committed Sep 6, 2023
1 parent 28f13a3 commit ae3bfc1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions traffic_ops/app/db/squash_migrations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ last_squashed_migration_timestamp="$(<<<"$last_squashed_migration" sed -E 's|mig
first_migration="$(ls migrations/*.sql | grep -A1 "/${last_squashed_migration_timestamp}_" | tail -n1)"
first_migration_timestamp="$(<<<"$first_migration" sed -E 's|migrations/([0-9]+).*|\1|')"
sed -i.bak '/^--/,$d' create_tables.sql # keeps the Apache License 2.0 header
sed -Ei.bak "s|(LastSquashedMigrationTimestamp\s+uint\s+= ).*|\1${last_squashed_migration_timestamp} // ${last_squashed_migration}|" admin.go
sed -Ei.bak "s|(FirstMigrationTimestamp\s+uint\s+= ).*|\1${first_migration_timestamp} // ${first_migration}|" admin.go

dump_db_with_migrations() {
trap 'echo "Error on line ${LINENO} of dump_db_with_migrations" >/dev/stderr; exit 1' ERR
Expand Down

0 comments on commit ae3bfc1

Please sign in to comment.