From 869a00f89709e86d81a3e3a75289eef13b469505 Mon Sep 17 00:00:00 2001 From: Ruben Koster Date: Tue, 12 Dec 2017 14:34:31 +0100 Subject: [PATCH] Don't leave old data laying around --- jobs/migrate-postgres/templates/pre-start.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jobs/migrate-postgres/templates/pre-start.erb b/jobs/migrate-postgres/templates/pre-start.erb index 1df0dc4..2914108 100755 --- a/jobs/migrate-postgres/templates/pre-start.erb +++ b/jobs/migrate-postgres/templates/pre-start.erb @@ -5,6 +5,8 @@ NEW_STORE_DIR=/var/vcap/store/postgres if [ ! -d ${NEW_STORE_DIR}/postgres-previous ]; then mkdir -p ${NEW_STORE_DIR} - ln -s ${OLD_STORE_DIR} ${NEW_STORE_DIR}/postgres-unknown + mv ${OLD_STORE_DIR} ${NEW_STORE_DIR}/postgres-unknown + ln -s ${NEW_STORE_DIR}/postgres-unknown ${OLD_STORE_DIR} /var/vcap/jobs/postgres/bin/pre-start + rm ${OLD_STORE_DIR} fi