Skip to content

Commit 3b02eec

Browse files
committed
[db migrator] migrate the DB to latest schema when needed (#2808)
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
1 parent f22666c commit 3b02eec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

files/build_templates/docker_image_ctl.j2

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ function postStartAction()
5959

6060
redis-cli -n 4 SET "CONFIG_DB_INITIALIZED" "1"
6161
fi
62+
63+
if [[ -x /usr/bin/db_migrator.py ]]; then
64+
# Migrate the DB to the latest schema version if needed
65+
/usr/bin/db_migrator.py -o migrate
66+
fi
6267
{%- elif docker_container_name == "swss" %}
6368
docker exec swss rm -f /ready # remove cruft
6469
if [[ "$BOOT_TYPE" == "fast" ]] && [[ -d /host/fast-reboot ]]; then

0 commit comments

Comments
 (0)