From a99cbefc194c3f107848bf3fdc74b19ea809d865 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Wed, 17 Sep 2014 22:19:54 -0700 Subject: [PATCH] run migrate for django 1.7 or evolve for django 1.5 --- opencloud.spec | 11 +++++------ planetstack/scripts/opencloud | 13 ++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/opencloud.spec b/opencloud.spec index 4d72a55..5831006 100644 --- a/opencloud.spec +++ b/opencloud.spec @@ -1,7 +1,7 @@ Summary: OpenCloud core services Name: opencloud -Version: 1.0.25 -Release: 8 +Version: 1.0.26 +Release: 7 License: GPL+ Group: Development/Tools Source0: %{_tmppath}/%{name}-%{version}.tar.gz @@ -29,7 +29,7 @@ requires: GeoIP # Empty section. %pre -#pip-python install django==1.5 +pip-python install django==1.7 pip-python install djangorestframework pip-python install markdown # Markdown support for the browseable API. pip-python install pyyaml # YAML content-type support. @@ -119,10 +119,9 @@ if [ "$1" == 1 ] ; then echo "NEW INSTALL - initializing database" /opt/planetstack/scripts/opencloud initdb else - echo "UPGRADE - doing evolution" + # scripts/opencloud will choose evolve or migrate depending on django version + echo "UPGRADE - doing evolution/migration" /opt/planetstack/scripts/opencloud evolvedb - #echo "UPGRADE - doing migration" - #/opt/planetstack/scripts/opencloud migratedb fi # start the server diff --git a/planetstack/scripts/opencloud b/planetstack/scripts/opencloud index ff6eefc..b307e66 100755 --- a/planetstack/scripts/opencloud +++ b/planetstack/scripts/opencloud @@ -134,15 +134,14 @@ if [ "$COMMAND" = "restoredb" ]; then createdb syncdb fi -if [ "$COMMAND" = "evolvedb" ]; then +if [ "$COMMAND" = "evolvedb" -o "$COMMAND" = "migratedb" ]; then stopserver ensure_postgres_running - evolvedb -fi -if [ "$COMMAND" = "migratedb" ]; then - stopserver - ensure_postgres_running - migratedb + if [[ $DJANGO_17 ]]; then + migratedb + else + evolvedb + fi fi if [ "$COMMAND" = "resetdb" ]; then stopserver -- 2.43.0