[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6905] trunk/LedgerSMB/DBH.pm



Revision: 6905
          http://sourceforge.net/p/ledger-smb/code/6905
Author:   einhverfr
Date:     2014-02-27 04:33:13 +0000 (Thu, 27 Feb 2014)
Log Message:
-----------
Zero-downtime upgrade support added.  This will be backported to 1.3.

Modified Paths:
--------------
    trunk/LedgerSMB/DBH.pm

Modified: trunk/LedgerSMB/DBH.pm
===================================================================
--- trunk/LedgerSMB/DBH.pm	2014-02-27 04:23:32 UTC (rev 6904)
+++ trunk/LedgerSMB/DBH.pm	2014-02-27 04:33:13 UTC (rev 6905)
@@ -85,13 +85,23 @@
 
 =head2 require_version($version)
 
-Requires a specific version (exactly).  Dies if doesn't match.
+Checks for a setting called 'ignore_version' and returns immediately if this is
+set and true.
 
+Otherwise, requires a specific version (exactly).  Dies if doesn't match.
+
+The ignore_version setting is intended to be temporarily set during 
+zero-downtime upgrades.
+
 =cut
 
 sub require_version {
     my ($self, $expected_version) = @_;
     $expected_version ||= $self; # handling ::require_version($version) syntax
+
+    my $ignore_version = LedgerSMB::Setting->get('ignore_version');
+    return if $ignore_version;
+
     my $version = LedgerSMB::Setting->get('version');
     die LedgerSMB::App_State->Locale->text("Database is not the expected version.  Was $version, expected $expected_version.  Please re-run setup.pl against this database to correct.<a href='setup.pl'>setup.pl</a>")
        unless $version eq $expected_version;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits