require DBIx::Class::Schema; # loaded for type constraint
use Carp::Clan '^DBIx::Class::DeploymentHandler';
use DBIx::Class::DeploymentHandler::Logger;
+use DBIx::Class::DeploymentHandler::Types;
use Log::Contextual ':log', -package_logger =>
DBIx::Class::DeploymentHandler::Logger->new({
env_prefix => 'DBICDH'
has schema_version => (
is => 'ro',
- isa => 'Str',
+ isa => 'StrSchemaVersion',
lazy_build => 1,
);
coerce 'DBIx::Class::DeploymentHandler::Databases'
=> from 'Str'
=> via { [$_] };
-no Moose::Util::TypeConstraints;
+subtype 'StrSchemaVersion'
+ => as 'Str'
+ => message {
+ defined $_
+ ? "Schema version (currently '$_') must be a string"
+ : 'Schema version must be defined'
+ };
+
+no Moose::Util::TypeConstraints;
1;
# vim: ts=2 sw=2 expandtab