Ignore:
Timestamp:
09/18/17 19:49:37 (7 years ago)
Author:
nanardon
Message:

Make sql-upgrade automatic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm

    r2082 r2083  
    1818our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0]; 
    1919 
    20 sub SCHEMA_VERSION { 11 }; 
     20sub SCHEMA_VERSION { 26 }; 
    2121 
    2222=head1 NAME 
     
    9898        $self->log(LA_DEBUG, 'New connection to DB'); 
    9999 
     100        { 
     101            my $sv = $self->get_global_value('schema_version') || 1; 
     102            if ($sv < SCHEMA_VERSION) { 
     103                require LATMOS::Accounts::Bases::Sql::upgrade; 
     104                if ($self->SchemaUpgrade()) { 
     105                    $self->commit; 
     106                } else { 
     107                    $self->rollback; 
     108                    return; 
     109                } 
     110            } 
     111        } 
    100112 
    101113        foreach my $otype ($self->list_supported_objects) { 
Note: See TracChangeset for help on using the changeset viewer.