527 # version of installed software |
527 # version of installed software |
528 eversion = dbversions['cubicweb'] |
528 eversion = dbversions['cubicweb'] |
529 status = instance_status(config, eversion, dbversions) |
529 status = instance_status(config, eversion, dbversions) |
530 # * database version > installed software |
530 # * database version > installed software |
531 if status == 'needsoftupgrade': |
531 if status == 'needsoftupgrade': |
532 print "database is using some earlier version than installed software!" |
532 print "** The database of %s is more recent than the installed software!" % config.appid |
533 print "please upgrade your software and then upgrade the instance" |
533 print "** Upgrade your software, then migrate the database by running the command" |
534 print "using command 'cubicweb-ctl upgrade %s'" % config.appid |
534 print "** 'cubicweb-ctl upgrade %s'" % config.appid |
535 return |
535 return |
536 # * database version < installed software, an upgrade will be necessary |
536 # * database version < installed software, an upgrade will be necessary |
537 # anyway, just rewrite vc.conf and warn user he has to upgrade |
537 # anyway, just rewrite vc.conf and warn user he has to upgrade |
538 if status == 'needapplupgrade': |
538 elif status == 'needapplupgrade': |
539 print "database is using some older version than installed software." |
539 print "** The database of %s is older than the installed software." % config.appid |
540 print "You'll have to upgrade the instance using command" |
540 print "** Migrate the database by running the command" |
541 print "'cubicweb-ctl upgrade %s'" % config.appid |
541 print "** 'cubicweb-ctl upgrade %s'" % config.appid |
542 return |
542 return |
543 # * database version = installed software, database version = instance fs version |
543 # * database version = installed software, database version = instance fs version |
544 # ok! |
544 # ok! |
545 |
|
546 |
545 |
547 def instance_status(config, cubicwebapplversion, vcconf): |
546 def instance_status(config, cubicwebapplversion, vcconf): |
548 cubicwebversion = config.cubicweb_version() |
547 cubicwebversion = config.cubicweb_version() |
549 if cubicwebapplversion > cubicwebversion: |
548 if cubicwebapplversion > cubicwebversion: |
550 return 'needsoftupgrade' |
549 return 'needsoftupgrade' |