From: Arthur Axel 'fREW' Schmidt Date: Wed, 2 Jun 2010 00:55:59 +0000 (-0500) Subject: Get rid of _generic support X-Git-Tag: v0.001000_13~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b766a244ca1fe004b66adb51b1a42c08bd2b373;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git Get rid of _generic support --- diff --git a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm index f91345f..24222ef 100644 --- a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm +++ b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm @@ -89,17 +89,14 @@ method __ddl_consume_with_prefix($type, $versions, $prefix) { my $base_dir = $self->script_directory; my $main = catfile( $base_dir, $type ); - my $generic = catfile( $base_dir, '_generic' ); my $common = catfile( $base_dir, '_common', $prefix, join q(-), @{$versions} ); my $dir; if (-d $main) { $dir = catfile($main, $prefix, join q(-), @{$versions}) - } elsif (-d $generic) { - $dir = catfile($generic, $prefix, join q(-), @{$versions}); } else { - croak "neither $main or $generic exist; please write/generate some SQL"; + croak "$main does not exist; please write/generate some SQL"; } my %files; @@ -686,17 +683,6 @@ like the best way to describe the layout is with the following example: | `- up | `- 1-2 | `- 002-generate-customers.pl - |- _generic - | |- down - | | `- 2-1 - | | `- 001-auto.sql - | |- schema - | | `- 1 - | | `- 001-auto.sql - | `- up - | `- 1-2 - | |- 001-auto.sql - | `- 002-create-stored-procedures.sql `- MySQL |- down | `- 2-1 @@ -727,9 +713,6 @@ C<$sql_migration_dir/_common/up/1-2/002-generate-customers.pl>. C<.pl> files don't have to be in the C<_common> directory, but most of the time they should be, because perl scripts are generally be database independent. -C<_generic> exists for when you for some reason are sure that your SQL is -generic enough to run on all databases. Good luck with that one. - Note that unlike most steps in the process, C will not run SQL, as there may not even be an database at preinstall time. It will run perl scripts just like the other steps in the process, but nothing is passed to them. @@ -765,13 +748,11 @@ of the schema at that version. These files are not for editing by hand. =back -=item C<$storage_type> This is a set of scripts that gets run depending on -what your storage type is. If you are not sure what your storage type is, -take a look at the producers listed for L. Also note, -C<_generic> and C<_common> are special cases. C<_generic> will get run if -there is no directory for your given storage, and C<_common> will get merged -into whatever other files (C<_generic> or your storage type) you already have. -This directory can containt the following directories itself: +=item C<$storage_type> This is a set of scripts that gets run depending on what +your storage type is. If you are not sure what your storage type is, take a +look at the producers listed for L. Also note, C<_common> +is a special case. C<_common> will get merged into whatever other files you +already have. This directory can containt the following directories itself: =over 2 diff --git a/t/deploy_methods/sql_translator.t b/t/deploy_methods/sql_translator.t index 4f10f65..bbb9845 100644 --- a/t/deploy_methods/sql_translator.t +++ b/t/deploy_methods/sql_translator.t @@ -228,10 +228,6 @@ VERSION3: { -f catfile(qw( t sql SQLite up 1.0-2.0 001-auto.sql )), '2.0-3.0 diff gets generated properly' ); - mkpath catfile(qw( t sql _generic up 2.0-3.0 )); - rename catfile(qw( t sql SQLite up 2.0-3.0 001-auto.sql )), catfile(qw( t sql _generic up 2.0-3.0 001-auto.sql )); - rmtree(catfile(qw( t sql SQLite ))); - warn 'how can this be' if -d catfile(qw( t sql SQLite )); dies_ok { $s->resultset('Foo')->create({ bar => 'frew', @@ -246,9 +242,7 @@ VERSION3: { baz => 'frew', biff => 'frew', }) - } 'schema is deployed using _generic'; - rmtree(catfile(qw( t sql SQLite ))); - rmtree(catfile(qw( t sql _generic ))); + } 'schema is deployed'; dies_ok { $dm->upgrade_single_step({ version_set => [qw( 2.0 3.0 )] }); } 'dies when sql dir does not exist';