Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix versioning test so it works with SQLT 0.09.

  • Loading branch information...
commit dd018f09328dbfb2c28a199bbb271d8323cb9a77 1 parent 3b7f3ea
Ash Berlin ashb authored
3  Changes
... ... @@ -1,5 +1,8 @@
1 1 Revision history for DBIx::Class
2 2
  3 +0.08010 2008-03-01 10:30
  4 + - Fix t/94versioning.t so it passes with latest SQL::Translator
  5 +
3 6 0.08009 2008-01-20 13:30
4 7 - Made search_rs smarter about when to preserve the cache to fix
5 8 mm prefetch usage
2  lib/DBIx/Class.pm
@@ -24,7 +24,7 @@ sub component_base_class { 'DBIx::Class' }
24 24 # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
25 25 # brain damage and presumably various other packaging systems too
26 26
27   -$VERSION = '0.08009';
  27 +$VERSION = '0.08010';
28 28
29 29 sub MODIFY_CODE_ATTRIBUTES {
30 30 my ($class,$code,@attrs) = @_;
25 lib/DBIx/Class/Schema/Versioned.pm
@@ -180,12 +180,7 @@ sub upgrade
180 180
181 181 $self->backup();
182 182
183   - $self->run_upgrade(qr/create/i);
184   - $self->run_upgrade(qr/alter table .*? add/i);
185   - $self->run_upgrade(qr/alter table .*? (?!drop)/i);
186   - $self->run_upgrade(qr/alter table .*? drop/i);
187   - $self->run_upgrade(qr/drop/i);
188   -# $self->run_upgrade(qr//i);
  183 + $self->run_upgrade();
189 184
190 185 my $vschema = DBIx::Class::Version->connect(@{$self->storage->connect_info()});
191 186 my $vtable = $vschema->resultset('Table');
@@ -198,6 +193,7 @@ sub upgrade
198 193 sub run_upgrade
199 194 {
200 195 my ($self, $stm) = @_;
  196 + $stm ||= qr//;
201 197 # print "Reg: $stm\n";
202 198 my @statements = grep { $_ =~ $stm } @{$self->_filedata};
203 199 # print "Statements: ", join("\n", @statements), "\n";
@@ -236,20 +232,6 @@ DBIx::Class::Schema::Versioned - DBIx::Class::Schema plugin for Schema upgrades
236 232 # my special backup process
237 233 }
238 234
239   - sub upgrade
240   - {
241   - my ($self) = @_;
242   -
243   - ## overridable sub, per default just runs all the commands.
244   -
245   - $self->run_upgrade(qr/create/i);
246   - $self->run_upgrade(qr/alter table .*? add/i);
247   - $self->run_upgrade(qr/alter table .*? (?!drop)/i);
248   - $self->run_upgrade(qr/alter table .*? drop/i);
249   - $self->run_upgrade(qr/drop/i);
250   - $self->run_upgrade(qr//i);
251   - }
252   -
253 235 =head1 DESCRIPTION
254 236
255 237 This module is a component designed to extend L<DBIx::Class::Schema>
@@ -308,6 +290,9 @@ idea is that this method can be called any number of times from your
308 290 C<upgrade> method, running whichever commands you specify via the
309 291 regex in the parameter.
310 292
  293 +B<NOTE:> Since SQL::Translator 0.09000 it is better to just run all statmets
  294 +in the order given, since the SQL produced is of better quality.
  295 +
311 296 =head2 upgrade_directory
312 297
313 298 Use this to set the directory your upgrade files are stored in.
2  lib/DBIx/Class/Storage.pm
@@ -262,7 +262,7 @@ which allows the rollback to propagate to the outermost transaction.
262 262
263 263 sub txn_rollback { die "Virtual method!" }
264 264
265   -=for
  265 +=for comment
266 266
267 267 =head2 txn_scope_guard
268 268
3  lib/DBIx/Class/Storage/TxnScopeGuard.pm
... ... @@ -1,4 +1,5 @@
1   -package DBIx::Class::Storage::TxnScopeGuard;
  1 +package # Hide from pause for now - till we get it working
  2 + DBIx::Class::Storage::TxnScopeGuard;
2 3
3 4 use strict;
4 5 use warnings;
4 t/94versioning.t
@@ -5,9 +5,9 @@ use Test::More;
5 5 use File::Spec;
6 6
7 7 BEGIN {
8   - eval "use DBD::SQLite; use SQL::Translator 0.08;";
  8 + eval "use DBD::SQLite; use SQL::Translator 0.09;";
9 9 plan $@
10   - ? ( skip_all => 'needs DBD::SQLite and SQL::Translator 0.08 for testing' )
  10 + ? ( skip_all => 'needs DBD::SQLite and SQL::Translator 0.09 for testing' )
11 11 : ( tests => 6 );
12 12 }
13 13

0 comments on commit dd018f0

Please sign in to comment.
Something went wrong with that request. Please try again.