1 package DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator;
4 # ABSTRACT: Manage your SQL and Perl migrations in nicely laid out directories
7 use Carp qw( carp croak );
8 use DBIx::Class::DeploymentHandler::Logger;
9 use Log::Contextual qw(:log :dlog), -package_logger =>
10 DBIx::Class::DeploymentHandler::Logger->new({
11 env_prefix => 'DBICDH'
13 use Context::Preserve;
18 require SQL::Translator::Diff;
20 require DBIx::Class::Storage; # loaded for type constraint
21 use DBIx::Class::DeploymentHandler::Types;
23 use File::Path 'mkpath';
24 use File::Spec::Functions;
26 with 'DBIx::Class::DeploymentHandler::HandlesDeploy';
34 has force_overwrite => (
46 isa => 'DBIx::Class::Storage',
53 my $s = $self->schema->storage;
54 $s->_determine_driver;
58 has sql_translator_args => (
61 default => sub { {} },
63 has script_directory => (
72 isa => 'DBIx::Class::DeploymentHandler::Databases',
74 default => sub { [qw( MySQL SQLite PostgreSQL )] },
83 has schema_version => (
89 # this will probably never get called as the DBICDH
90 # will be passing down a schema_version normally, which
91 # is built the same way, but we leave this in place
92 sub _build_schema_version {
94 $self->schema->schema_version
97 sub __ddl_consume_with_prefix {
98 my ($self, $type, $versions, $prefix) = @_;
99 my $base_dir = $self->script_directory;
101 my $main = catfile( $base_dir, $type );
103 catfile( $base_dir, '_common', $prefix, join q(-), @{$versions} );
106 catfile( $base_dir, '_common', $prefix, '_any' );
110 $dir = catfile($main, $prefix, join q(-), @{$versions})
112 if ($self->ignore_ddl) {
115 croak "$main does not exist; please write/generate some SQL"
118 my $dir_any = catfile($main, $prefix, '_any');
122 opendir my($dh), $dir;
124 map { $_ => "$dir/$_" }
125 grep { /\.(?:sql|pl|sql-\w+)$/ && -f "$dir/$_" }
129 die $_ unless $self->ignore_ddl;
131 for my $dirname (grep { -d $_ } $common, $common_any, $dir_any) {
132 opendir my($dh), $dirname;
133 for my $filename (grep { /\.(?:sql|pl)$/ && -f catfile($dirname,$_) } readdir $dh) {
134 unless ($files{$filename}) {
135 $files{$filename} = catfile($dirname,$filename);
141 return [@files{sort keys %files}]
144 sub _ddl_initialize_consume_filenames {
145 my ($self, $type, $version) = @_;
146 $self->__ddl_consume_with_prefix($type, [ $version ], 'initialize')
149 sub _ddl_schema_consume_filenames {
150 my ($self, $type, $version) = @_;
151 $self->__ddl_consume_with_prefix($type, [ $version ], 'deploy')
154 sub _ddl_protoschema_deploy_consume_filenames {
155 my ($self, $version) = @_;
156 my $base_dir = $self->script_directory;
158 my $dir = catfile( $base_dir, '_source', 'deploy', $version);
159 return [] unless -d $dir;
161 opendir my($dh), $dir;
162 my %files = map { $_ => "$dir/$_" } grep { /\.yml$/ && -f "$dir/$_" } readdir $dh;
165 return [@files{sort keys %files}]
168 sub _ddl_protoschema_upgrade_consume_filenames {
169 my ($self, $versions) = @_;
170 my $base_dir = $self->script_directory;
172 my $dir = catfile( $base_dir, '_preprocess_schema', 'upgrade', join q(-), @{$versions});
174 return [] unless -d $dir;
176 opendir my($dh), $dir;
177 my %files = map { $_ => "$dir/$_" } grep { /\.pl$/ && -f "$dir/$_" } readdir $dh;
180 return [@files{sort keys %files}]
183 sub _ddl_protoschema_downgrade_consume_filenames {
184 my ($self, $versions) = @_;
185 my $base_dir = $self->script_directory;
187 my $dir = catfile( $base_dir, '_preprocess_schema', 'downgrade', join q(-), @{$versions});
189 return [] unless -d $dir;
191 opendir my($dh), $dir;
192 my %files = map { $_ => "$dir/$_" } grep { /\.pl$/ && -f "$dir/$_" } readdir $dh;
195 return [@files{sort keys %files}]
198 sub _ddl_protoschema_produce_filename {
199 my ($self, $version) = @_;
200 my $dirname = catfile( $self->script_directory, '_source', 'deploy', $version );
201 mkpath($dirname) unless -d $dirname;
203 return catfile( $dirname, '001-auto.yml' );
206 sub _ddl_schema_produce_filename {
207 my ($self, $type, $version) = @_;
208 my $dirname = catfile( $self->script_directory, $type, 'deploy', $version );
209 mkpath($dirname) unless -d $dirname;
211 return catfile( $dirname, '001-auto.sql' );
214 sub _ddl_schema_upgrade_consume_filenames {
215 my ($self, $type, $versions) = @_;
216 $self->__ddl_consume_with_prefix($type, $versions, 'upgrade')
219 sub _ddl_schema_downgrade_consume_filenames {
220 my ($self, $type, $versions) = @_;
221 $self->__ddl_consume_with_prefix($type, $versions, 'downgrade')
224 sub _ddl_schema_upgrade_produce_filename {
225 my ($self, $type, $versions) = @_;
226 my $dir = $self->script_directory;
228 my $dirname = catfile( $dir, $type, 'upgrade', join q(-), @{$versions});
229 mkpath($dirname) unless -d $dirname;
231 return catfile( $dirname, '001-auto.sql' );
234 sub _ddl_schema_downgrade_produce_filename {
235 my ($self, $type, $versions, $dir) = @_;
236 my $dirname = catfile( $dir, $type, 'downgrade', join q(-), @{$versions} );
237 mkpath($dirname) unless -d $dirname;
239 return catfile( $dirname, '001-auto.sql');
243 my ($self, $sql) = @_;
244 my $storage = $self->storage;
246 $sql = [ _split_sql_chunk( @$sql ) ];
248 Dlog_trace { "Running SQL $_" } $sql;
249 foreach my $line (@{$sql}) {
250 $storage->_query_start($line);
251 # the whole reason we do this is so that we can see the line that was run
253 $storage->dbh_do (sub { $_[1]->do($line) });
256 die "$_ (running line '$line')"
258 $storage->_query_end($line);
260 return join "\n", @$sql
263 # split a chunk o' SQL into statements
264 sub _split_sql_chunk {
265 my @sql = map { split /;\n/, $_ } @_;
269 s/^(?:BEGIN|BEGIN TRANSACTION|COMMIT).*//mgi;
288 my ($self, $filename) = @_;
289 log_debug { "Running SQL from $filename" };
290 return $self->_run_sql_array($self->_read_sql_file($filename));
296 my $_package = $_file;
297 $_package =~ s/([^A-Za-z0-9_])/sprintf("_%2x", ord($1))/eg;
299 my $fn = eval sprintf <<'END_EVAL', $_package;
300 package DBICDH::Sandbox::%s;
303 $app ||= require $_file;
304 if ( !$app && ( my $error = $@ || $! )) { die $error; }
311 croak "$_file should define an anonymous sub that takes a schema but it didn't!"
312 unless ref $fn && ref $fn eq 'CODE';
318 my ($self, $filename, $versions) = @_;
319 log_debug { "Running Perl from $filename" };
321 my $fn = _load_sandbox($filename);
323 Dlog_trace { "Running Perl $_" } $fn;
325 $fn->($self->schema, $versions)
329 my ( $self, $code ) = @_;
330 return $code->() unless $self->txn_wrap;
332 my $guard = $self->schema->txn_scope_guard;
334 return preserve_context { $code->() } after => sub { $guard->commit };
337 sub _run_sql_and_perl {
338 my ($self, $filenames, $sql_to_run, $versions) = @_;
339 my @files = @{$filenames};
341 $self->_run_sql_array($sql_to_run) if $self->ignore_ddl;
343 my $sql = ($sql_to_run)?join ";\n", @$sql_to_run:'';
345 for my $filename (@files) {
346 if ($self->ignore_ddl && $filename =~ /^[^_]*-auto.*\.sql$/) {
348 } elsif ($filename =~ /\.sql$/) {
349 $sql .= $self->_run_sql($filename)
350 } elsif ( $filename =~ /\.pl$/ ) {
351 $self->_run_perl($filename, $versions)
353 croak "A file ($filename) got to deploy that wasn't sql or perl!";
363 my $version = (shift @_ || {})->{version} || $self->schema_version;
364 log_info { "deploying version $version" };
365 my $sqlt_type = $self->storage->sqlt_type;
367 if ($self->ignore_ddl) {
368 $sql = $self->_sql_from_yaml({},
369 '_ddl_protoschema_deploy_consume_filenames', $sqlt_type
372 return $self->_run_sql_and_perl($self->_ddl_schema_consume_filenames(
375 ), $sql, [$version]);
381 my $version = $args->{version} || $self->schema_version;
382 log_info { "initializing version $version" };
383 my $storage_type = $args->{storage_type} || $self->storage->sqlt_type;
385 my @files = @{$self->_ddl_initialize_consume_filenames(
390 for my $filename (@files) {
391 # We ignore sql for now (till I figure out what to do with it)
392 if ( $filename =~ /^(.+)\.pl$/ ) {
393 my $filedata = do { local( @ARGV, $/ ) = $filename; <> };
395 no warnings 'redefine';
396 my $fn = eval "$filedata";
400 croak "$filename failed to compile: $@";
401 } elsif (ref $fn eq 'CODE') {
404 croak "$filename should define an anonymous sub but it didn't!";
407 croak "A file ($filename) got to initialize_scripts that wasn't sql or perl!";
412 sub _sqldiff_from_yaml {
413 my ($self, $from_version, $to_version, $db, $direction) = @_;
414 my $dir = $self->script_directory;
417 ignore_constraint_names => 1,
418 ignore_index_names => 1,
419 %{$self->sql_translator_args}
424 my $prefilename = $self->_ddl_protoschema_produce_filename($from_version, $dir);
426 # should probably be a croak
427 carp("No previous schema file found ($prefilename)")
428 unless -e $prefilename;
430 my $t = SQL::Translator->new({
434 parser => 'SQL::Translator::Parser::YAML',
437 my $out = $t->translate( $prefilename )
440 $source_schema = $t->schema;
442 $source_schema->name( $prefilename )
443 unless $source_schema->name;
448 my $filename = $self->_ddl_protoschema_produce_filename($to_version, $dir);
450 # should probably be a croak
451 carp("No next schema file found ($filename)")
454 my $t = SQL::Translator->new({
458 parser => 'SQL::Translator::Parser::YAML',
461 my $out = $t->translate( $filename )
464 $dest_schema = $t->schema;
466 $dest_schema->name( $filename )
467 unless $dest_schema->name;
470 my $transform_files_method = "_ddl_protoschema_${direction}_consume_filenames";
471 my $transforms = $self->_coderefs_per_files(
472 $self->$transform_files_method([$from_version, $to_version])
474 $_->($source_schema, $dest_schema) for @$transforms;
476 return [SQL::Translator::Diff::schema_diff(
484 my ($self, $sqltargs, $from_file, $db) = @_;
485 my $schema = $self->schema;
486 my $version = $self->schema_version;
490 my $actual_file = $self->$from_file($version);
491 for my $yaml_filename (@{
492 DlogS_trace { "generating SQL from Serialized SQL Files: $_" }
493 (ref $actual_file?$actual_file:[$actual_file])
495 my $sqlt = SQL::Translator->new({
497 parser => 'SQL::Translator::Parser::YAML',
502 push @sql, $sqlt->translate($yaml_filename);
504 carp("Failed to translate to $db, skipping. (" . $sqlt->error . ")");
511 sub _prepare_install {
513 my $sqltargs = { %{$self->sql_translator_args}, %{shift @_} };
514 my $from_file = shift;
516 my $dir = $self->script_directory;
517 my $databases = $self->databases;
518 my $version = $self->schema_version;
520 foreach my $db (@$databases) {
521 my $sql = $self->_sql_from_yaml($sqltargs, $from_file, $db ) or next;
523 my $filename = $self->$to_file($db, $version, $dir);
525 if ($self->force_overwrite) {
526 carp "Overwriting existing DDL file - $filename";
529 die "Cannot overwrite '$filename', either enable force_overwrite or delete it"
532 open my $file, q(>), $filename;
533 print {$file} join ";\n", @$sql;
538 sub _resultsource_install_filename {
539 my ($self, $source_name) = @_;
541 my ($self, $type, $version) = @_;
542 my $dirname = catfile( $self->script_directory, $type, 'deploy', $version );
543 mkpath($dirname) unless -d $dirname;
545 return catfile( $dirname, "001-auto-$source_name.sql" );
549 sub _resultsource_protoschema_filename {
550 my ($self, $source_name) = @_;
552 my ($self, $version) = @_;
553 my $dirname = catfile( $self->script_directory, '_source', 'deploy', $version );
554 mkpath($dirname) unless -d $dirname;
556 return catfile( $dirname, "001-auto-$source_name.yml" );
560 sub install_resultsource {
561 my ($self, $args) = @_;
562 my $source = $args->{result_source}
563 or die 'result_source must be passed to install_resultsource';
564 my $version = $args->{version}
565 or die 'version must be passed to install_resultsource';
566 log_info { 'installing_resultsource ' . $source->source_name . ", version $version" };
567 my $rs_install_file =
568 $self->_resultsource_install_filename($source->source_name);
571 $self->$rs_install_file(
572 $self->storage->sqlt_type,
576 $self->_run_sql_and_perl($files, '', [$version]);
579 sub prepare_resultsource_install {
581 my $source = (shift @_)->{result_source};
582 log_info { 'preparing install for resultsource ' . $source->source_name };
584 my $install_filename = $self->_resultsource_install_filename($source->source_name);
585 my $proto_filename = $self->_resultsource_protoschema_filename($source->source_name);
586 $self->prepare_protoschema({
587 parser_args => { sources => [$source->source_name], }
589 $self->_prepare_install({}, $proto_filename, $install_filename);
593 log_info { 'preparing deploy' };
595 $self->prepare_protoschema({
596 # Exclude __VERSION so that it gets installed separately
597 parser_args => { sources => [grep { $_ ne '__VERSION' } $self->schema->sources], }
598 }, '_ddl_protoschema_produce_filename');
599 $self->_prepare_install({}, '_ddl_protoschema_produce_filename', '_ddl_schema_produce_filename');
602 sub prepare_upgrade {
603 my ($self, $args) = @_;
605 "preparing upgrade from $args->{from_version} to $args->{to_version}"
607 $self->_prepare_changegrade(
608 $args->{from_version}, $args->{to_version}, $args->{version_set}, 'upgrade'
612 sub prepare_downgrade {
613 my ($self, $args) = @_;
615 "preparing downgrade from $args->{from_version} to $args->{to_version}"
617 $self->_prepare_changegrade(
618 $args->{from_version}, $args->{to_version}, $args->{version_set}, 'downgrade'
622 sub _coderefs_per_files {
623 my ($self, $files) = @_;
624 no warnings 'redefine';
625 [map eval do { local( @ARGV, $/ ) = $_; <> }, @$files]
628 sub _prepare_changegrade {
629 my ($self, $from_version, $to_version, $version_set, $direction) = @_;
630 my $schema = $self->schema;
631 my $databases = $self->databases;
632 my $dir = $self->script_directory;
634 my $schema_version = $self->schema_version;
635 my $diff_file_method = "_ddl_schema_${direction}_produce_filename";
636 foreach my $db (@$databases) {
637 my $diff_file = $self->$diff_file_method($db, $version_set, $dir );
639 if ($self->force_overwrite) {
640 carp("Overwriting existing $direction-diff file - $diff_file");
643 die "Cannot overwrite '$diff_file', either enable force_overwrite or delete it"
647 open my $file, q(>), $diff_file;
648 print {$file} join ";\n", @{$self->_sqldiff_from_yaml($from_version, $to_version, $db, $direction)};
654 my ($self, $file) = @_;
657 local $/ = undef; #sluuuuuurp
659 open my $fh, '<', $file;
660 return [ _split_sql_chunk( <$fh> ) ];
663 sub downgrade_single_step {
665 my $version_set = (shift @_)->{version_set};
666 Dlog_info { "downgrade_single_step'ing $_" } $version_set;
668 my $sqlt_type = $self->storage->sqlt_type;
670 if ($self->ignore_ddl) {
671 $sql_to_run = $self->_sqldiff_from_yaml(
672 $version_set->[0], $version_set->[1], $sqlt_type, 'downgrade',
675 my $sql = $self->_run_sql_and_perl($self->_ddl_schema_downgrade_consume_filenames(
678 ), $sql_to_run, $version_set);
683 sub upgrade_single_step {
685 my $version_set = (shift @_)->{version_set};
686 Dlog_info { "upgrade_single_step'ing $_" } $version_set;
688 my $sqlt_type = $self->storage->sqlt_type;
690 if ($self->ignore_ddl) {
691 $sql_to_run = $self->_sqldiff_from_yaml(
692 $version_set->[0], $version_set->[1], $sqlt_type, 'upgrade',
695 my $sql = $self->_run_sql_and_perl($self->_ddl_schema_upgrade_consume_filenames(
698 ), $sql_to_run, $version_set);
702 sub prepare_protoschema {
704 my $sqltargs = { %{$self->sql_translator_args}, %{shift @_} };
707 = $self->$to_file($self->schema_version);
709 # we do this because the code that uses this sets parser args,
710 # so we just need to merge in the package
711 $sqltargs->{parser_args}{package} = $self->schema;
712 my $sqlt = SQL::Translator->new({
713 parser => 'SQL::Translator::Parser::DBIx::Class',
714 producer => 'SQL::Translator::Producer::YAML',
718 my $yml = $sqlt->translate;
720 croak("Failed to translate to YAML: " . $sqlt->error)
724 if ($self->force_overwrite) {
725 carp "Overwriting existing DDL-YML file - $filename";
728 die "Cannot overwrite '$filename', either enable force_overwrite or delete it"
732 open my $file, q(>), $filename;
737 __PACKAGE__->meta->make_immutable;
741 # vim: ts=2 sw=2 expandtab
747 This class is the meat of L<DBIx::Class::DeploymentHandler>. It takes care
748 of generating serialized schemata as well as sql files to move from one
749 version of a schema to the rest. One of the hallmark features of this class
750 is that it allows for multiple sql files for deploy and upgrade, allowing
751 developers to fine tune deployment. In addition it also allows for perl
752 files to be run at any stage of the process.
754 For basic usage see L<DBIx::Class::DeploymentHandler::HandlesDeploy>. What's
755 documented here is extra fun stuff or private methods.
757 =head1 DIRECTORY LAYOUT
759 Arguably this is the best feature of L<DBIx::Class::DeploymentHandler>.
760 It's spiritually based upon L<DBIx::Migration::Directories>, but has a
761 lot of extensions and modifications, so even if you are familiar with it,
762 please read this. I feel like the best way to describe the layout is with
763 the following example:
789 | | `- 002-remove-customers.pl
792 | | `- 002-generate-customers.pl
794 | `- 999-bump-action.pl
801 | |- 001-create_database.pl
802 | `- 002-create_users_and_permissions.pl
810 So basically, the code
814 on an C<SQLite> database that would simply run
815 C<$sql_migration_dir/SQLite/deploy/1/001-auto.sql>. Next,
817 $dm->upgrade_single_step([1,2])
819 would run C<$sql_migration_dir/SQLite/upgrade/1-2/001-auto.sql> followed by
820 C<$sql_migration_dir/_common/upgrade/1-2/002-generate-customers.pl>, and
821 finally punctuated by
822 C<$sql_migration_dir/_common/upgrade/_any/999-bump-action.pl>.
824 C<.pl> files don't have to be in the C<_common> directory, but most of the time
825 they should be, because perl scripts are generally database independent.
827 Note that unlike most steps in the process, C<initialize> will not run SQL, as
828 there may not even be an database at initialize time. It will run perl scripts
829 just like the other steps in the process, but nothing is passed to them.
830 Until people have used this more it will remain freeform, but a recommended use
831 of initialize is to have it prompt for username and password, and then call the
832 appropriate C<< CREATE DATABASE >> commands etc.
834 =head2 Directory Specification
836 The following subdirectories are recognized by this DeployMethod:
840 =item C<_source> This directory can contain the following directories:
844 =item C<deploy> This directory merely contains directories named after schema
845 versions, which in turn contain C<yaml> files that are serialized versions
846 of the schema at that version. These files are not for editing by hand.
850 =item C<_preprocess_schema> This directory can contain the following
855 =item C<downgrade> This directory merely contains directories named after
856 migrations, which are of the form C<$from_version-$to_version>. Inside of
857 these directories you may put Perl scripts which are to return a subref
858 that takes the arguments C<< $from_schema, $to_schema >>, which are
859 L<SQL::Translator::Schema> objects.
861 =item C<upgrade> This directory merely contains directories named after
862 migrations, which are of the form C<$from_version-$to_version>. Inside of
863 these directories you may put Perl scripts which are to return a subref
864 that takes the arguments C<< $from_schema, $to_schema >>, which are
865 L<SQL::Translator::Schema> objects.
869 =item C<$storage_type> This is a set of scripts that gets run depending on what
870 your storage type is. If you are not sure what your storage type is, take a
871 look at the producers listed for L<SQL::Translator>. Also note, C<_common>
872 is a special case. C<_common> will get merged into whatever other files you
873 already have. This directory can contain the following directories itself:
877 =item C<initialize> Gets run before the C<deploy> is C<deploy>ed. Has the
878 same structure as the C<deploy> subdirectory as well; that is, it has a
879 directory for each schema version. Unlike C<deploy>, C<upgrade>, and C<downgrade>
880 though, it can only run C<.pl> files, and the coderef in the perl files get
881 no arguments passed to them.
883 =item C<deploy> Gets run when the schema is C<deploy>ed. Structure is a
884 directory per schema version, and then files are merged with C<_common> and run
885 in filename order. C<.sql> files are merely run, as expected. C<.pl> files are
886 run according to L</PERL SCRIPTS>.
888 =item C<upgrade> Gets run when the schema is C<upgrade>d. Structure is a directory
889 per upgrade step, (for example, C<1-2> for upgrading from version 1 to version
890 2,) and then files are merged with C<_common> and run in filename order.
891 C<.sql> files are merely run, as expected. C<.pl> files are run according
894 =item C<downgrade> Gets run when the schema is C<downgrade>d. Structure is a directory
895 per downgrade step, (for example, C<2-1> for downgrading from version 2 to version
896 1,) and then files are merged with C<_common> and run in filename order.
897 C<.sql> files are merely run, as expected. C<.pl> files are run according
905 Note that there can be an C<_any> in the place of any of the versions (like
906 C<1-2> or C<1>), which means those scripts will be run B<every> time. So if
907 you have an C<_any> in C<_common/upgrade>, that script will get run for every
912 A perl script for this tool is very simple. It merely needs to contain an
913 anonymous sub that takes a L<DBIx::Class::Schema> and the version set as it's
916 A very basic perl script might look like:
923 use DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::ScriptHelpers
924 'schema_from_schema_loader';
926 schema_from_schema_loader({ naming => 'v4' }, sub {
929 # [1] for deploy, [1,2] for upgrade or downgrade, probably used with _any
930 my $versions = shift;
932 $schema->resultset('Users')->create({
938 Note that the above uses
939 L<DBIx::Class::DeploymentHanlder::DeployMethod::SQL::Translator::ScriptHelpers/schema_from_schema_loader>.
940 Using a raw coderef is strongly discouraged as it is likely to break as you
945 This attribute will, when set to true (default is false), cause the DM to use
946 L<SQL::Translator> to use the C<_source>'s serialized SQL::Translator::Schema
947 instead of any pregenerated SQL. If you have a development server this is
948 probably the best plan of action as you will not be putting as many generated
949 files in your version control. Goes well with with C<databases> of C<[]>.
951 =attr force_overwrite
953 When this attribute is true generated files will be overwritten when the
954 methods which create such files are run again. The default is false, in which
955 case the program will die with a message saying which file needs to be deleted.
959 The L<DBIx::Class::Schema> (B<required>) that is used to talk to the database
960 and generate the DDL.
964 The L<DBIx::Class::Storage> that is I<actually> used to talk to the database
965 and generate the DDL. This is automatically created with L</_build_storage>.
967 =attr sql_translator_args
969 The arguments that get passed to L<SQL::Translator> when it's used.
971 =attr script_directory
973 The directory (default C<'sql'>) that scripts are stored in
977 The types of databases (default C<< [qw( MySQL SQLite PostgreSQL )] >>) to
982 Set to true (which is the default) to wrap all upgrades and deploys in a single
987 The version the schema on your harddrive is at. Defaults to
988 C<< $self->schema->schema_version >>.
992 This class is an implementation of
993 L<DBIx::Class::DeploymentHandler::HandlesDeploy>. Pretty much all the
994 documentation is there.