From: Gordon Irving Date: Mon, 9 Aug 2010 22:50:02 +0000 (+0100) Subject: Add missing attributes to Admin.pm (referenced in dbicadmin's POD) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f33862043c4b1e9f5823bc407585b43582dbcd5a;p=dbsrgits%2FDBIx-Class-Historic.git Add missing attributes to Admin.pm (referenced in dbicadmin's POD) --- diff --git a/Changes b/Changes index ed1bfa4..69f1e95 100644 --- a/Changes +++ b/Changes @@ -39,6 +39,7 @@ Revision history for DBIx::Class FK value and related object out of sync - Stop stripping newlines from SQL statements in the limit emulators as it is possible that custom sql with comments was provided + - Add forgotten attributes to Admin.pm * Misc - Switch all serialization to use Storable::nfreeze for portable diff --git a/lib/DBIx/Class/Admin.pm b/lib/DBIx/Class/Admin.pm index 7052fbf..c7640da 100644 --- a/lib/DBIx/Class/Admin.pm +++ b/lib/DBIx/Class/Admin.pm @@ -232,6 +232,17 @@ has 'sql_dir' => ( ); +=head2 sql_type + +The type of sql dialect to use for creating sql files from schema + +=cut + +has 'sql_type' => ( + is => 'ro', + isa => Str, +); + =head2 version Used for install, the version which will be 'installed' in the schema @@ -285,6 +296,24 @@ has '_confirm' => ( ); +=head2 trace + +Toggle DBIx::Class debug output + +=cut + +has trace => ( + is => 'rw', + isa => Bool, + trigger => \&_trigger_trace, +); + +sub _trigger_trace { + my ($self, $new, $old) = @_; + $self->schema->storage->debug($new); +} + + =head1 METHODS =head2 create @@ -309,6 +338,7 @@ sub create { my ($self, $sqlt_type, $sqlt_args, $preversion) = @_; $preversion ||= $self->preversion(); + $sqlt_type ||= $self->sql_type(); my $schema = $self->schema(); # create the dir if does not exist