Skip to content

Commit

Permalink
[db migrator] migrate the DB to latest schema when needed (#2808)
Browse files Browse the repository at this point in the history
Signed-off-by: Ying Xie <[email protected]>
  • Loading branch information
yxieca committed Apr 30, 2019
1 parent f22666c commit 3b02eec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ function postStartAction()

redis-cli -n 4 SET "CONFIG_DB_INITIALIZED" "1"
fi

if [[ -x /usr/bin/db_migrator.py ]]; then
# Migrate the DB to the latest schema version if needed
/usr/bin/db_migrator.py -o migrate
fi
{%- elif docker_container_name == "swss" %}
docker exec swss rm -f /ready # remove cruft
if [[ "$BOOT_TYPE" == "fast" ]] && [[ -d /host/fast-reboot ]]; then
Expand Down

0 comments on commit 3b02eec

Please sign in to comment.