summaryrefslogtreecommitdiffstats
path: root/bitbake/bin
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-12-03 12:51:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-10 11:16:14 +0000
commit415ebb738da2a9625d6cc1456f4e99e463797c31 (patch)
tree323d58d2f4262db2fda5161b96736ef639947cfc /bitbake/bin
parent81ebce07788cd4c5f53cb6ad7b51ee3d6e52c881 (diff)
downloadpoky-415ebb738da2a9625d6cc1456f4e99e463797c31.tar.gz
bitbake: toaster: migrate orm models to South
As Toaster advances, database schema alteration will force users to delete old versions and lose all data collected. In order to prevent this, and to allow database updates to happen without having to delete old data, we use South to handle migrations for the ORM application which stores the Toaster data. [YOCTO #5559] (Bitbake rev: 6936faed8d94f3a2ab4055049cd27d02d8229003) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-xbitbake/bin/toaster16
1 files changed, 15 insertions, 1 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 7e51014b7d..fc59fe5547 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -40,9 +40,16 @@ function webserverStartAll()
40{ 40{
41 retval=0 41 retval=0
42 python $BBBASEDIR/lib/toaster/manage.py syncdb || retval=1 42 python $BBBASEDIR/lib/toaster/manage.py syncdb || retval=1
43 python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=2
43 if [ $retval -eq 1 ]; then 44 if [ $retval -eq 1 ]; then
44 echo "Failed db sync, stopping system start" 1>&2 45 echo "Failed db sync, stopping system start" 1>&2
45 else 46 elif [ $retval -eq 2 ]; then
47 echo -e "\nError on migration, trying to recover... \n"
48 python $BBBASEDIR/lib/toaster/manage.py migrate orm 0001_initial --fake
49 retval=0
50 python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=1
51 fi
52 if [ $retval -eq 0 ]; then
46 python $BBBASEDIR/lib/toaster/manage.py runserver 0.0.0.0:8000 </dev/null >${BUILDDIR}/toaster_web.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid 53 python $BBBASEDIR/lib/toaster/manage.py runserver 0.0.0.0:8000 </dev/null >${BUILDDIR}/toaster_web.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid
47 fi 54 fi
48 return $retval 55 return $retval
@@ -92,6 +99,13 @@ if ! echo "import django; print (1,5) == django.VERSION[0:2]" | python 2>/dev/nu
92 return 2 99 return 2
93fi 100fi
94 101
102if ! echo "import south; print [0,8,4] == map(int,south.__version__.split(\".\"))" | python 2>/dev/null | grep True >/dev/null; then
103 echo -e "This program needs South 0.8.4. Please install with\n\nsudo pip install south==0.8.4"
104 return 2
105fi
106
107
108
95 109
96 110
97# Determine the action. If specified by arguments, fine, if not, toggle it 111# Determine the action. If specified by arguments, fine, if not, toggle it