| 1 | package DBIO::DeploymentHandler::VersionStorage::Standard::Component; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Attach this component to your schema to ensure you stay up to date | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 4 | our $VERSION = '0.900007'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use DBIO::Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use DBIO::DeploymentHandler::VersionStorage::Standard::VersionResult; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 4 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 5 | ▶ | sub attach_version_storage { | ||||||||||||||||||||||||||
|
Subroutine
attach_version_storage: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 16 | 5 | $_[0]->register_class( | |||||||||||||||||||||||||||
| 17 | __VERSION => 'DBIO::DeploymentHandler::VersionStorage::Standard::VersionResult' | ||||||||||||||||||||||||||||
| 18 | ); | ||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 5 | ▶ | sub connection { | ||||||||||||||||||||||||||
|
Subroutine
connection: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||
| 23 | 5 | my $self = shift; | |||||||||||||||||||||||||||
| 24 | 5 | $self->next::method(@_); | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 5 | $self->attach_version_storage; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 5 | my $args = $self->storage->_dbio_connect_attributes; # fork-rename: was _dbic_connect_attributes | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 5 | ▶ | unless ( $args->{ignore_version} || $ENV{DBIO_NO_VERSION_CHECK}) { # documented name; legacy DBIC_NO_VERSION_CHECK still honored in DBIO::Storage::DBI | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$args->{"ignore_version"} or $ENV{"DBIO_NO_VERSION_CHECK"}
MC/DC100%2/2
$args->{"ignore_version"} or $ENV{"DBIO_NO_VERSION_CHECK"}
$args->{"ignore_version"}
$ENV{"DBIO_NO_VERSION_CHECK"}
Truth table100%3/3
A or B
A= $args->{"ignore_version"}B= $ENV{"DBIO_NO_VERSION_CHECK"}
| |||||||||||||||||||||||||||||
| 31 | 3 | my $versions = $self->resultset('__VERSION'); | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 3 | ▶ | if (!$versions->version_storage_is_installed) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 34 | 1 | carp "Your DB is currently unversioned. Please call upgrade on your schema to sync the DB.\n"; | |||||||||||||||||||||||||||
| 35 | } elsif ($versions->database_version ne $self->schema_version) { | ||||||||||||||||||||||||||||
| 36 | 1 | carp 'Versions out of sync. This is ' . $self->schema_version . | |||||||||||||||||||||||||||
| 37 | ', your database contains version ' . $versions->database_version . ", please call upgrade on your Schema.\n"; | ||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 5 | return $self; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 4 | 1; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | # vim: ts=2 sw=2 expandtab | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | __END__ | ||||||||||||||||||||||||||||