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 => (
41 isa => 'DBIx::Class::Schema',
47 isa => 'DBIx::Class::Storage',
54 my $s = $self->schema->storage;
55 $s->_determine_driver;
59 has sql_translator_args => (
62 default => sub { {} },
64 has script_directory => (
73 isa => 'DBIx::Class::DeploymentHandler::Databases',
75 default => sub { [qw( MySQL SQLite PostgreSQL )] },
84 has schema_version => (
90 # this will probably never get called as the DBICDH
91 # will be passing down a schema_version normally, which
92 # is built the same way, but we leave this in place
93 sub _build_schema_version {
95 $self->schema->schema_version
98 sub __ddl_consume_with_prefix {
99 my ($self, $type, $versions, $prefix) = @_;
100 my $base_dir = $self->script_directory;
102 my $main = catfile( $base_dir, $type );
104 catfile( $base_dir, '_common', $prefix, join q(-), @{$versions} );
107 catfile( $base_dir, '_common', $prefix, '_any' );
111 $dir = catfile($main, $prefix, join q(-), @{$versions})
113 if ($self->ignore_ddl) {
116 croak "$main does not exist; please write/generate some SQL"
119 my $dir_any = catfile($main, $prefix, '_any');
123 opendir my($dh), $dir;
125 map { $_ => "$dir/$_" }
126 grep { /\.(?:sql|pl|sql-\w+)$/ && -f "$dir/$_" }
130 die $_ unless $self->ignore_ddl;
132 for my $dirname (grep { -d $_ } $common, $common_any, $dir_any) {
133 opendir my($dh), $dirname;
134 for my $filename (grep { /\.(?:sql|pl)$/ && -f catfile($dirname,$_) } readdir $dh) {
135 unless ($files{$filename}) {
136 $files{$filename} = catfile($dirname,$filename);
142 return [@files{sort keys %files}]
145 sub _ddl_initialize_consume_filenames {
146 my ($self, $type, $version) = @_;
147 $self->__ddl_consume_with_prefix($type, [ $version ], 'initialize')
150 sub _ddl_schema_consume_filenames {
151 my ($self, $type, $version) = @_;
152 $self->__ddl_consume_with_prefix($type, [ $version ], 'deploy')
155 sub _ddl_protoschema_deploy_consume_filenames {
156 my ($self, $version) = @_;
157 my $base_dir = $self->script_directory;
159 my $dir = catfile( $base_dir, '_source', 'deploy', $version);
160 return [] unless -d $dir;
162 opendir my($dh), $dir;
163 my %files = map { $_ => "$dir/$_" } grep { /\.yml$/ && -f "$dir/$_" } readdir $dh;
166 return [@files{sort keys %files}]
169 sub _ddl_protoschema_upgrade_consume_filenames {
170 my ($self, $versions) = @_;
171 my $base_dir = $self->script_directory;
173 my $dir = catfile( $base_dir, '_preprocess_schema', 'upgrade', join q(-), @{$versions});
175 return [] unless -d $dir;
177 opendir my($dh), $dir;
178 my %files = map { $_ => "$dir/$_" } grep { /\.pl$/ && -f "$dir/$_" } readdir $dh;
181 return [@files{sort keys %files}]
184 sub _ddl_protoschema_downgrade_consume_filenames {
185 my ($self, $versions) = @_;
186 my $base_dir = $self->script_directory;
188 my $dir = catfile( $base_dir, '_preprocess_schema', 'downgrade', join q(-), @{$versions});
190 return [] unless -d $dir;
192 opendir my($dh), $dir;
193 my %files = map { $_ => "$dir/$_" } grep { /\.pl$/ && -f "$dir/$_" } readdir $dh;
196 return [@files{sort keys %files}]
199 sub _ddl_protoschema_produce_filename {
200 my ($self, $version) = @_;
201 my $dirname = catfile( $self->script_directory, '_source', 'deploy', $version );
202 mkpath($dirname) unless -d $dirname;
204 return catfile( $dirname, '001-auto.yml' );
207 sub _ddl_schema_produce_filename {
208 my ($self, $type, $version) = @_;
209 my $dirname = catfile( $self->script_directory, $type, 'deploy', $version );
210 mkpath($dirname) unless -d $dirname;
212 return catfile( $dirname, '001-auto.sql' );
215 sub _ddl_schema_upgrade_consume_filenames {
216 my ($self, $type, $versions) = @_;
217 $self->__ddl_consume_with_prefix($type, $versions, 'upgrade')
220 sub _ddl_schema_downgrade_consume_filenames {
221 my ($self, $type, $versions) = @_;
222 $self->__ddl_consume_with_prefix($type, $versions, 'downgrade')
225 sub _ddl_schema_upgrade_produce_filename {
226 my ($self, $type, $versions) = @_;
227 my $dir = $self->script_directory;
229 my $dirname = catfile( $dir, $type, 'upgrade', join q(-), @{$versions});
230 mkpath($dirname) unless -d $dirname;
232 return catfile( $dirname, '001-auto.sql' );
235 sub _ddl_schema_downgrade_produce_filename {
236 my ($self, $type, $versions, $dir) = @_;
237 my $dirname = catfile( $dir, $type, 'downgrade', join q(-), @{$versions} );
238 mkpath($dirname) unless -d $dirname;
240 return catfile( $dirname, '001-auto.sql');
244 my ($self, $sql) = @_;
245 my $storage = $self->storage;
247 $sql = [ _split_sql_chunk( @$sql ) ];
249 Dlog_trace { "Running SQL $_" } $sql;
250 foreach my $line (@{$sql}) {
251 $storage->_query_start($line);
252 # the whole reason we do this is so that we can see the line that was run
254 $storage->dbh_do (sub { $_[1]->do($line) });
257 die "$_ (running line '$line')"
259 $storage->_query_end($line);
261 return join "\n", @$sql
264 # split a chunk o' SQL into statements
265 sub _split_sql_chunk {
266 my @sql = map { split /;\n/, $_ } @_;
270 s/^(?:BEGIN|BEGIN TRANSACTION|COMMIT).*//mgi;
289 my ($self, $filename) = @_;
290 log_debug { "Running SQL from $filename" };
291 return $self->_run_sql_array($self->_read_sql_file($filename));
294 # stolen from Plack::Util::_load_sandbox
298 my $_package = $_file;
299 $_package =~ s/([^A-Za-z0-9_])/sprintf("_%2x", unpack("C", $1))/eg;
301 local $0 = $_file; # so FindBin etc. works
303 return eval sprintf <<'END_EVAL', $_package;
304 package DBICDH::Sandbox::%s;
307 if ( !$app && ( my $error = $@ || $! )) { die $error; }
314 my ($self, $filename, $versions) = @_;
315 log_debug { "Running Perl from $filename" };
316 my $filedata = do { local( @ARGV, $/ ) = $filename; <> };
318 my $fn = _load_sandbox($filename);
320 Dlog_trace { "Running Perl $_" } $fn;
322 if (ref $fn eq 'CODE') {
323 $fn->($self->schema, $versions)
325 croak "$filename should define an anonymouse sub that takes a schema but it didn't!";
330 my ( $self, $code ) = @_;
331 return $code->() unless $self->txn_wrap;
333 my $guard = $self->schema->txn_scope_guard;
335 return preserve_context { $code->() } after => sub { $guard->commit };
338 sub _run_sql_and_perl {
339 my ($self, $filenames, $sql_to_run, $versions) = @_;
340 my @files = @{$filenames};
342 $self->_run_sql_array($sql_to_run) if $self->ignore_ddl;
344 my $sql = ($sql_to_run)?join ";\n", @$sql_to_run:'';
346 for my $filename (@files) {
347 if ($self->ignore_ddl && $filename =~ /^[^_]*-auto.*\.sql$/) {
349 } elsif ($filename =~ /\.sql$/) {
350 $sql .= $self->_run_sql($filename)
351 } elsif ( $filename =~ /\.pl$/ ) {
352 $self->_run_perl($filename, $versions)
354 croak "A file ($filename) got to deploy that wasn't sql or perl!";
364 my $version = (shift @_ || {})->{version} || $self->schema_version;
365 log_info { "deploying version $version" };
366 my $sqlt_type = $self->storage->sqlt_type;
368 if ($self->ignore_ddl) {
369 $sql = $self->_sql_from_yaml({},
370 '_ddl_protoschema_deploy_consume_filenames', $sqlt_type
373 return $self->_run_sql_and_perl($self->_ddl_schema_consume_filenames(
376 ), $sql, [$version]);
382 my $version = $args->{version} || $self->schema_version;
383 log_info { "initializing version $version" };
384 my $storage_type = $args->{storage_type} || $self->storage->sqlt_type;
386 my @files = @{$self->_ddl_initialize_consume_filenames(
391 for my $filename (@files) {
392 # We ignore sql for now (till I figure out what to do with it)
393 if ( $filename =~ /^(.+)\.pl$/ ) {
394 my $filedata = do { local( @ARGV, $/ ) = $filename; <> };
396 no warnings 'redefine';
397 my $fn = eval "$filedata";
401 croak "$filename failed to compile: $@";
402 } elsif (ref $fn eq 'CODE') {
405 croak "$filename should define an anonymous sub but it didn't!";
408 croak "A file ($filename) got to initialize_scripts that wasn't sql or perl!";
413 sub _sqldiff_from_yaml {
414 my ($self, $from_version, $to_version, $db, $direction) = @_;
415 my $dir = $self->script_directory;
418 ignore_constraint_names => 1,
419 ignore_index_names => 1,
420 %{$self->sql_translator_args}
425 my $prefilename = $self->_ddl_protoschema_produce_filename($from_version, $dir);
427 # should probably be a croak
428 carp("No previous schema file found ($prefilename)")
429 unless -e $prefilename;
431 my $t = SQL::Translator->new({
435 parser => 'SQL::Translator::Parser::YAML',
438 my $out = $t->translate( $prefilename )
441 $source_schema = $t->schema;
443 $source_schema->name( $prefilename )
444 unless $source_schema->name;
449 my $filename = $self->_ddl_protoschema_produce_filename($to_version, $dir);
451 # should probably be a croak
452 carp("No next schema file found ($filename)")
455 my $t = SQL::Translator->new({
459 parser => 'SQL::Translator::Parser::YAML',
462 my $out = $t->translate( $filename )
465 $dest_schema = $t->schema;
467 $dest_schema->name( $filename )
468 unless $dest_schema->name;
471 my $transform_files_method = "_ddl_protoschema_${direction}_consume_filenames";
472 my $transforms = $self->_coderefs_per_files(
473 $self->$transform_files_method([$from_version, $to_version])
475 $_->($source_schema, $dest_schema) for @$transforms;
477 return [SQL::Translator::Diff::schema_diff(
485 my ($self, $sqltargs, $from_file, $db) = @_;
486 my $schema = $self->schema;
487 my $version = $self->schema_version;
491 my $actual_file = $self->$from_file($version);
492 for my $yaml_filename (@{
493 DlogS_trace { "generating SQL from Serialized SQL Files: $_" }
494 (ref $actual_file?$actual_file:[$actual_file])
496 my $sqlt = SQL::Translator->new({
498 parser => 'SQL::Translator::Parser::YAML',
503 push @sql, $sqlt->translate($yaml_filename);
505 carp("Failed to translate to $db, skipping. (" . $sqlt->error . ")");
512 sub _prepare_install {
514 my $sqltargs = { %{$self->sql_translator_args}, %{shift @_} };
515 my $from_file = shift;
517 my $dir = $self->script_directory;
518 my $databases = $self->databases;
519 my $version = $self->schema_version;
521 foreach my $db (@$databases) {
522 my $sql = $self->_sql_from_yaml($sqltargs, $from_file, $db ) or next;
524 my $filename = $self->$to_file($db, $version, $dir);
526 if ($self->force_overwrite) {
527 carp "Overwriting existing DDL file - $filename";
530 die "Cannot overwrite '$filename', either enable force_overwrite or delete it"
533 open my $file, q(>), $filename;
534 print {$file} join ";\n", @$sql;
539 sub _resultsource_install_filename {
540 my ($self, $source_name) = @_;
542 my ($self, $type, $version) = @_;
543 my $dirname = catfile( $self->script_directory, $type, 'deploy', $version );
544 mkpath($dirname) unless -d $dirname;
546 return catfile( $dirname, "001-auto-$source_name.sql" );
550 sub _resultsource_protoschema_filename {
551 my ($self, $source_name) = @_;
553 my ($self, $version) = @_;
554 my $dirname = catfile( $self->script_directory, '_source', 'deploy', $version );
555 mkpath($dirname) unless -d $dirname;
557 return catfile( $dirname, "001-auto-$source_name.yml" );
561 sub install_resultsource {
562 my ($self, $args) = @_;
563 my $source = $args->{result_source}
564 or die 'result_source must be passed to install_resultsource';
565 my $version = $args->{version}
566 or die 'version must be passed to install_resultsource';
567 log_info { 'installing_resultsource ' . $source->source_name . ", version $version" };
568 my $rs_install_file =
569 $self->_resultsource_install_filename($source->source_name);
572 $self->$rs_install_file(
573 $self->storage->sqlt_type,
577 $self->_run_sql_and_perl($files, '', [$version]);
580 sub prepare_resultsource_install {
582 my $source = (shift @_)->{result_source};
583 log_info { 'preparing install for resultsource ' . $source->source_name };
585 my $install_filename = $self->_resultsource_install_filename($source->source_name);
586 my $proto_filename = $self->_resultsource_protoschema_filename($source->source_name);
587 $self->prepare_protoschema({
588 parser_args => { sources => [$source->source_name], }
590 $self->_prepare_install({}, $proto_filename, $install_filename);
594 log_info { 'preparing deploy' };
596 $self->prepare_protoschema({
597 # Exclude __VERSION so that it gets installed separately
598 parser_args => { sources => [grep { $_ ne '__VERSION' } $self->schema->sources], }
599 }, '_ddl_protoschema_produce_filename');
600 $self->_prepare_install({}, '_ddl_protoschema_produce_filename', '_ddl_schema_produce_filename');
603 sub prepare_upgrade {
604 my ($self, $args) = @_;
606 "preparing upgrade from $args->{from_version} to $args->{to_version}"
608 $self->_prepare_changegrade(
609 $args->{from_version}, $args->{to_version}, $args->{version_set}, 'upgrade'
613 sub prepare_downgrade {
614 my ($self, $args) = @_;
616 "preparing downgrade from $args->{from_version} to $args->{to_version}"
618 $self->_prepare_changegrade(
619 $args->{from_version}, $args->{to_version}, $args->{version_set}, 'downgrade'
623 sub _coderefs_per_files {
624 my ($self, $files) = @_;
625 no warnings 'redefine';
626 [map eval do { local( @ARGV, $/ ) = $_; <> }, @$files]
629 sub _prepare_changegrade {
630 my ($self, $from_version, $to_version, $version_set, $direction) = @_;
631 my $schema = $self->schema;
632 my $databases = $self->databases;
633 my $dir = $self->script_directory;
635 my $schema_version = $self->schema_version;
636 my $diff_file_method = "_ddl_schema_${direction}_produce_filename";
637 foreach my $db (@$databases) {
638 my $diff_file = $self->$diff_file_method($db, $version_set, $dir );
640 if ($self->force_overwrite) {
641 carp("Overwriting existing $direction-diff file - $diff_file");
644 die "Cannot overwrite '$diff_file', either enable force_overwrite or delete it"
648 open my $file, q(>), $diff_file;
649 print {$file} join ";\n", @{$self->_sqldiff_from_yaml($from_version, $to_version, $db, $direction)};
655 my ($self, $file) = @_;
658 local $/ = undef; #sluuuuuurp
660 open my $fh, '<', $file;
661 return [ _split_sql_chunk( <$fh> ) ];
664 sub downgrade_single_step {
666 my $version_set = (shift @_)->{version_set};
667 Dlog_info { "downgrade_single_step'ing $_" } $version_set;
669 my $sqlt_type = $self->storage->sqlt_type;
671 if ($self->ignore_ddl) {
672 $sql_to_run = $self->_sqldiff_from_yaml(
673 $version_set->[0], $version_set->[1], $sqlt_type, 'downgrade',
676 my $sql = $self->_run_sql_and_perl($self->_ddl_schema_downgrade_consume_filenames(
679 ), $sql_to_run, $version_set);
684 sub upgrade_single_step {
686 my $version_set = (shift @_)->{version_set};
687 Dlog_info { "upgrade_single_step'ing $_" } $version_set;
689 my $sqlt_type = $self->storage->sqlt_type;
691 if ($self->ignore_ddl) {
692 $sql_to_run = $self->_sqldiff_from_yaml(
693 $version_set->[0], $version_set->[1], $sqlt_type, 'upgrade',
696 my $sql = $self->_run_sql_and_perl($self->_ddl_schema_upgrade_consume_filenames(
699 ), $sql_to_run, $version_set);
703 sub prepare_protoschema {
705 my $sqltargs = { %{$self->sql_translator_args}, %{shift @_} };
708 = $self->$to_file($self->schema_version);
710 # we do this because the code that uses this sets parser args,
711 # so we just need to merge in the package
712 $sqltargs->{parser_args}{package} = $self->schema;
713 my $sqlt = SQL::Translator->new({
714 parser => 'SQL::Translator::Parser::DBIx::Class',
715 producer => 'SQL::Translator::Producer::YAML',
719 my $yml = $sqlt->translate;
721 croak("Failed to translate to YAML: " . $sqlt->error)
725 if ($self->force_overwrite) {
726 carp "Overwriting existing DDL-YML file - $filename";
729 die "Cannot overwrite '$filename', either enable force_overwrite or delete it"
733 open my $file, q(>), $filename;
738 __PACKAGE__->meta->make_immutable;
742 # vim: ts=2 sw=2 expandtab
748 This class is the meat of L<DBIx::Class::DeploymentHandler>. It takes care
749 of generating serialized schemata as well as sql files to move from one
750 version of a schema to the rest. One of the hallmark features of this class
751 is that it allows for multiple sql files for deploy and upgrade, allowing
752 developers to fine tune deployment. In addition it also allows for perl
753 files to be run at any stage of the process.
755 For basic usage see L<DBIx::Class::DeploymentHandler::HandlesDeploy>. What's
756 documented here is extra fun stuff or private methods.
758 =head1 DIRECTORY LAYOUT
760 Arguably this is the best feature of L<DBIx::Class::DeploymentHandler>.
761 It's spiritually based upon L<DBIx::Migration::Directories>, but has a
762 lot of extensions and modifications, so even if you are familiar with it,
763 please read this. I feel like the best way to describe the layout is with
764 the following example:
790 | | `- 002-remove-customers.pl
793 | | `- 002-generate-customers.pl
795 | `- 999-bump-action.pl
802 | |- 001-create_database.pl
803 | `- 002-create_users_and_permissions.pl
811 So basically, the code
815 on an C<SQLite> database that would simply run
816 C<$sql_migration_dir/SQLite/deploy/1/001-auto.sql>. Next,
818 $dm->upgrade_single_step([1,2])
820 would run C<$sql_migration_dir/SQLite/upgrade/1-2/001-auto.sql> followed by
821 C<$sql_migration_dir/_common/upgrade/1-2/002-generate-customers.pl>, and
822 finally punctuated by
823 C<$sql_migration_dir/_common/upgrade/_any/999-bump-action.pl>.
825 C<.pl> files don't have to be in the C<_common> directory, but most of the time
826 they should be, because perl scripts are generally database independent.
828 Note that unlike most steps in the process, C<initialize> will not run SQL, as
829 there may not even be an database at initialize time. It will run perl scripts
830 just like the other steps in the process, but nothing is passed to them.
831 Until people have used this more it will remain freeform, but a recommended use
832 of initialize is to have it prompt for username and password, and then call the
833 appropriate C<< CREATE DATABASE >> commands etc.
835 =head2 Directory Specification
837 The following subdirectories are recognized by this DeployMethod:
841 =item C<_source> This directory can contain the following directories:
845 =item C<deploy> This directory merely contains directories named after schema
846 versions, which in turn contain C<yaml> files that are serialized versions
847 of the schema at that version. These files are not for editing by hand.
851 =item C<_preprocess_schema> This directory can contain the following
856 =item C<downgrade> This directory merely contains directories named after
857 migrations, which are of the form C<$from_version-$to_version>. Inside of
858 these directories you may put Perl scripts which are to return a subref
859 that takes the arguments C<< $from_schema, $to_schema >>, which are
860 L<SQL::Translator::Schema> objects.
862 =item C<upgrade> This directory merely contains directories named after
863 migrations, which are of the form C<$from_version-$to_version>. Inside of
864 these directories you may put Perl scripts which are to return a subref
865 that takes the arguments C<< $from_schema, $to_schema >>, which are
866 L<SQL::Translator::Schema> objects.
870 =item C<$storage_type> This is a set of scripts that gets run depending on what
871 your storage type is. If you are not sure what your storage type is, take a
872 look at the producers listed for L<SQL::Translator>. Also note, C<_common>
873 is a special case. C<_common> will get merged into whatever other files you
874 already have. This directory can contain the following directories itself:
878 =item C<initialize> Gets run before the C<deploy> is C<deploy>ed. Has the
879 same structure as the C<deploy> subdirectory as well; that is, it has a
880 directory for each schema version. Unlike C<deploy>, C<upgrade>, and C<downgrade>
881 though, it can only run C<.pl> files, and the coderef in the perl files get
882 no arguments passed to them.
884 =item C<deploy> Gets run when the schema is C<deploy>ed. Structure is a
885 directory per schema version, and then files are merged with C<_common> and run
886 in filename order. C<.sql> files are merely run, as expected. C<.pl> files are
887 run according to L</PERL SCRIPTS>.
889 =item C<upgrade> Gets run when the schema is C<upgrade>d. Structure is a directory
890 per upgrade step, (for example, C<1-2> for upgrading from version 1 to version
891 2,) and then files are merged with C<_common> and run in filename order.
892 C<.sql> files are merely run, as expected. C<.pl> files are run according
895 =item C<downgrade> Gets run when the schema is C<downgrade>d. Structure is a directory
896 per downgrade step, (for example, C<2-1> for downgrading from version 2 to version
897 1,) and then files are merged with C<_common> and run in filename order.
898 C<.sql> files are merely run, as expected. C<.pl> files are run according
906 Note that there can be an C<_any> in the place of any of the versions (like
907 C<1-2> or C<1>), which means those scripts will be run B<every> time. So if
908 you have an C<_any> in C<_common/upgrade>, that script will get run for every
913 A perl script for this tool is very simple. It merely needs to contain an
914 anonymous sub that takes a L<DBIx::Class::Schema> and the version set as it's
917 A very basic perl script might look like:
924 use DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::ScriptHelpers
925 'schema_from_schema_loader';
927 schema_from_schema_loader({ naming => 'v4' }, sub {
930 # [1] for deploy, [1,2] for upgrade or downgrade, probably used with _any
931 my $versions = shift;
933 $schema->resultset('Users')->create({
939 Note that the above uses
940 L<DBIx::Class::DeploymentHanlder::DeployMethod::SQL::Translator::ScriptHelpers/schema_from_schema_loader>.
941 Using a raw coderef is strongly discouraged as it is likely to break as you
946 This attribute will, when set to true (default is false), cause the DM to use
947 L<SQL::Translator> to use the C<_source>'s serialized SQL::Translator::Schema
948 instead of any pregenerated SQL. If you have a development server this is
949 probably the best plan of action as you will not be putting as many generated
950 files in your version control. Goes well with with C<databases> of C<[]>.
952 =attr force_overwrite
954 When this attribute is true generated files will be overwritten when the
955 methods which create such files are run again. The default is false, in which
956 case the program will die with a message saying which file needs to be deleted.
960 The L<DBIx::Class::Schema> (B<required>) that is used to talk to the database
961 and generate the DDL.
965 The L<DBIx::Class::Storage> that is I<actually> used to talk to the database
966 and generate the DDL. This is automatically created with L</_build_storage>.
968 =attr sql_translator_args
970 The arguments that get passed to L<SQL::Translator> when it's used.
972 =attr script_directory
974 The directory (default C<'sql'>) that scripts are stored in
978 The types of databases (default C<< [qw( MySQL SQLite PostgreSQL )] >>) to
983 Set to true (which is the default) to wrap all upgrades and deploys in a single
988 The version the schema on your harddrive is at. Defaults to
989 C<< $self->schema->schema_version >>.