[jifty-devel] Re: [Jifty-commit] r4381 - jifty/trunk/lib/Jifty

Jesse Vincent jesse at bestpractical.com
Tue Nov 6 10:51:51 EST 2007


Cl: will you add doc for this?

jifty-commit at lists.jifty.org wrote:
> Author: clkao
> Date: Tue Nov  6 03:11:39 2007
> New Revision: 4381
> 
> Modified:
>    jifty/trunk/lib/Jifty/Handle.pm
> 
> Log:
> Add a ForwardCompatible config in Database section.  The usecase
> is that when you switch your checkout to something with older
> version of app schema, you can declare it is compatiable with
> the future version that is currently in db.
> 
> 
> Modified: jifty/trunk/lib/Jifty/Handle.pm
> ==============================================================================
> --- jifty/trunk/lib/Jifty/Handle.pm	(original)
> +++ jifty/trunk/lib/Jifty/Handle.pm	Tue Nov  6 03:11:39 2007
> @@ -91,7 +91,7 @@
>  
>      my %lc_db_config;
>      # Skip the non-dsn keys, but not anything else
> -    for (grep {!/^checkschema|version|recordbaseclass|attributes$/i} keys %db_config) {
> +    for (grep {!/^checkschema|version|forwardcompatible|recordbaseclass|attributes$/i} keys %db_config) {
>          $lc_db_config{lc($_)} = $db_config{$_};
>      }
>      $self->SUPER::connect( %lc_db_config , %args);
> @@ -145,10 +145,15 @@
>              . "\t bin/jifty schema --setup\n"
>              unless defined $dbv;
>  
> -        die
> +        unless (version->new($appv) == version->new($dbv)) {
> +            # if app version is older than db version, but we are still compatible
> +            my $compat = delete Jifty->config->framework('Database')->{'ForwardCompatible'} || $appv;
> +            warn "==> $compat";
> +            die
>              "Application schema version in database ($dbv) doesn't match application schema version ($appv)\n"
>              . "Please run `bin/jifty schema --setup` to upgrade the database.\n"
> -            unless version->new($appv) == version->new($dbv);
> +                if version->new($appv) > version->new($dbv) || version->new($compat) < version->new($dbv);
> +        }
>      }
>  
>      # Jifty db version check
> _______________________________________________
> Jifty-commit mailing list
> Jifty-commit at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-commit
> 



More information about the jifty-devel mailing list