From 05265224f3a69a70d1dada76163e7f8892c4e039 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 9 Aug 2012 16:47:23 +0000 Subject: [PATCH] Fix script order execution for scripts with >4 digits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So we had the 9999->10000 switch in our svn now. Scripts >=10000 need to be executed after <=9999. This code has never happend. Nothing to see here, move along… ٩(͡๏̯͡๏)۶ From: Michael Prokop --- ngcp-update-db-schema | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ngcp-update-db-schema b/ngcp-update-db-schema index b5462032..9fd07b65 100755 --- a/ngcp-update-db-schema +++ b/ngcp-update-db-schema @@ -169,7 +169,14 @@ revision_wrapper() { done } -revision_wrapper /usr/share/ngcp-db-schema/db_scripts/base/*.up -revision_wrapper /usr/share/ngcp-db-schema/db_scripts/diff/*.up +# make sure we get sorted 10XXX after 9XXX +cd /usr/share/ngcp-db-schema/db_scripts/base/ +revision_wrapper $(printf '%s\0' *.up | sort -z -n | while IFS= read -r -d "" file; do \ + echo /usr/share/ngcp-db-schema/db_scripts/base/$file; done) + +cd /usr/share/ngcp-db-schema/db_scripts/diff/ +revision_wrapper $(printf '%s\0' *.up | sort -z -n | while IFS= read -r -d "" file; do \ + echo /usr/share/ngcp-db-schema/db_scripts/diff/$file; done) + ## END OF FILE #################################################################