| 1 | package DBIx::Class::DeploymentHandler::VersionStorage::Standard::Component; | ||||||||||||||||||||||||||||
| 2 | 17 | $DBIx::Class::DeploymentHandler::VersionStorage::Standard::Component::VERSION = '0.002233'; | |||||||||||||||||||||||||||
| 3 | # ABSTRACT: Attach this component to your schema to ensure you stay up to date | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 17 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 17 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 17 | ▶ | use Carp 'carp'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 17 | ▶ | use DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | sub attach_version_storage { | ||||||||||||||||||||||||||||
| 12 | 45 | ▶ | $_[0]->register_class( | ||||||||||||||||||||||||||
|
Subroutine
attach_version_storage: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | __VERSION => 'DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult' | ||||||||||||||||||||||||||||
| 14 | ); | ||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | sub connection { | ||||||||||||||||||||||||||||
| 18 | 45 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
connection: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 19 | 45 | $self->next::method(@_); | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 45 | $self->attach_version_storage; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 45 | my $args = $self->storage->_dbic_connect_attributes; | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 45 | ▶ | unless ( $args->{ignore_version} || $ENV{DBIC_NO_VERSION_CHECK}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$args->{"ignore_version"} or $ENV{"DBIC_NO_VERSION_CHECK"}
MC/DC50%1/2
$args->{"ignore_version"} or $ENV{"DBIC_NO_VERSION_CHECK"}
$args->{"ignore_version"}
$ENV{"DBIC_NO_VERSION_CHECK"}
Truth table66%2/3
A or B
A= $args->{"ignore_version"}B= $ENV{"DBIC_NO_VERSION_CHECK"}
| |||||||||||||||||||||||||||||
| 26 | 2 | my $versions = $self->resultset('__VERSION'); | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 2 | ▶ | if (!$versions->version_storage_is_installed) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 29 | 1 | carp "Your DB is currently unversioned. Please call upgrade on your schema to sync the DB.\n"; | |||||||||||||||||||||||||||
| 30 | } elsif ($versions->database_version ne $self->schema_version) { | ||||||||||||||||||||||||||||
| 31 | 1 | carp 'Versions out of sync. This is ' . $self->schema_version . | |||||||||||||||||||||||||||
| 32 | ', your database contains version ' . $versions->database_version . ", please call upgrade on your Schema.\n"; | ||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 45 | return $self; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 17 | 1; | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | # vim: ts=2 sw=2 expandtab | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | =pod | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | =head1 NAME | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | DBIx::Class::DeploymentHandler::VersionStorage::Standard::Component - Attach this component to your schema to ensure you stay up to date | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com> | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | This software is copyright (c) 2019 by Arthur Axel "fREW" Schmidt. | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 60 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | =cut | ||||||||||||||||||||||||||||