From: Arthur Axel 'fREW' Schmidt Date: Tue, 18 May 2010 03:57:40 +0000 (-0500) Subject: disallow undef in versions X-Git-Tag: v0.001000_10~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e86c0c07a9464b4a3cab37b9dfcf9971a8dd151b;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git disallow undef in versions --- diff --git a/Changes b/Changes index 70e0d07..e87649d 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for {{$dist->name}} {{$NEXT}} + - stricter validation (no undef) on versions to prevent weird surprises - change method args to named args - document method args - preconnect should not connect to the database diff --git a/lib/DBIx/Class/DeploymentHandler/Dad.pm b/lib/DBIx/Class/DeploymentHandler/Dad.pm index 92bbb93..d816acd 100644 --- a/lib/DBIx/Class/DeploymentHandler/Dad.pm +++ b/lib/DBIx/Class/DeploymentHandler/Dad.pm @@ -21,6 +21,7 @@ has backup_directory => ( has to_version => ( is => 'ro', + isa => 'Str', lazy_build => 1, ); @@ -28,6 +29,7 @@ sub _build_to_version { $_[0]->schema_version } has schema_version => ( is => 'ro', + isa => 'Str', lazy_build => 1, ); diff --git a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm index 0d232fd..b1a2c01 100644 --- a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm +++ b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm @@ -65,6 +65,7 @@ has txn_wrap => ( has schema_version => ( is => 'ro', + isa => 'Str', lazy_build => 1, ); diff --git a/lib/DBIx/Class/DeploymentHandler/VersionHandler/DatabaseToSchemaVersions.pm b/lib/DBIx/Class/DeploymentHandler/VersionHandler/DatabaseToSchemaVersions.pm index 1762553..de34af0 100644 --- a/lib/DBIx/Class/DeploymentHandler/VersionHandler/DatabaseToSchemaVersions.pm +++ b/lib/DBIx/Class/DeploymentHandler/VersionHandler/DatabaseToSchemaVersions.pm @@ -21,8 +21,8 @@ has database_version => ( has to_version => ( # configuration is => 'ro', - lazy_build => 1, # builder comes from another role... - # which is... probably not how we want it + isa => 'Str', + lazy_build => 1, ); sub _build_to_version { $_[0]->schema_version } diff --git a/lib/DBIx/Class/DeploymentHandler/VersionHandler/ExplicitVersions.pm b/lib/DBIx/Class/DeploymentHandler/VersionHandler/ExplicitVersions.pm index 0781c43..625e2f6 100644 --- a/lib/DBIx/Class/DeploymentHandler/VersionHandler/ExplicitVersions.pm +++ b/lib/DBIx/Class/DeploymentHandler/VersionHandler/ExplicitVersions.pm @@ -21,6 +21,7 @@ has database_version => ( has to_version => ( is => 'ro', + isa => 'Str', lazy_build => 1, );