[Bast-commits] r4113 - in DBIx-Class/0.08/trunk: . lib/DBIx
lib/DBIx/Class lib/DBIx/Class/Schema lib/DBIx/Class/Storage t
ash at dev.catalyst.perl.org
ash at dev.catalyst.perl.org
Sat Mar 1 12:17:54 GMT 2008
Author: ash
Date: 2008-03-01 12:17:54 +0000 (Sat, 01 Mar 2008)
New Revision: 4113
Modified:
DBIx-Class/0.08/trunk/Changes
DBIx-Class/0.08/trunk/lib/DBIx/Class.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/TxnScopeGuard.pm
DBIx-Class/0.08/trunk/t/94versioning.t
Log:
Fix versioning test so it works with SQLT 0.09.
Modified: DBIx-Class/0.08/trunk/Changes
===================================================================
--- DBIx-Class/0.08/trunk/Changes 2008-03-01 04:47:07 UTC (rev 4112)
+++ DBIx-Class/0.08/trunk/Changes 2008-03-01 12:17:54 UTC (rev 4113)
@@ -1,5 +1,8 @@
Revision history for DBIx::Class
+0.08010 2008-03-01 10:30
+ - Fix t/94versioning.t so it passes with latest SQL::Translator
+
0.08009 2008-01-20 13:30
- Made search_rs smarter about when to preserve the cache to fix
mm prefetch usage
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm 2008-03-01 04:47:07 UTC (rev 4112)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm 2008-03-01 12:17:54 UTC (rev 4113)
@@ -180,12 +180,7 @@
$self->backup();
- $self->run_upgrade(qr/create/i);
- $self->run_upgrade(qr/alter table .*? add/i);
- $self->run_upgrade(qr/alter table .*? (?!drop)/i);
- $self->run_upgrade(qr/alter table .*? drop/i);
- $self->run_upgrade(qr/drop/i);
-# $self->run_upgrade(qr//i);
+ $self->run_upgrade();
my $vschema = DBIx::Class::Version->connect(@{$self->storage->connect_info()});
my $vtable = $vschema->resultset('Table');
@@ -198,6 +193,7 @@
sub run_upgrade
{
my ($self, $stm) = @_;
+ $stm ||= qr//;
# print "Reg: $stm\n";
my @statements = grep { $_ =~ $stm } @{$self->_filedata};
# print "Statements: ", join("\n", @statements), "\n";
@@ -236,20 +232,6 @@
# my special backup process
}
- sub upgrade
- {
- my ($self) = @_;
-
- ## overridable sub, per default just runs all the commands.
-
- $self->run_upgrade(qr/create/i);
- $self->run_upgrade(qr/alter table .*? add/i);
- $self->run_upgrade(qr/alter table .*? (?!drop)/i);
- $self->run_upgrade(qr/alter table .*? drop/i);
- $self->run_upgrade(qr/drop/i);
- $self->run_upgrade(qr//i);
- }
-
=head1 DESCRIPTION
This module is a component designed to extend L<DBIx::Class::Schema>
@@ -308,6 +290,9 @@
C<upgrade> method, running whichever commands you specify via the
regex in the parameter.
+B<NOTE:> Since SQL::Translator 0.09000 it is better to just run all statmets
+in the order given, since the SQL produced is of better quality.
+
=head2 upgrade_directory
Use this to set the directory your upgrade files are stored in.
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/TxnScopeGuard.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/TxnScopeGuard.pm 2008-03-01 04:47:07 UTC (rev 4112)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/TxnScopeGuard.pm 2008-03-01 12:17:54 UTC (rev 4113)
@@ -1,4 +1,5 @@
-package DBIx::Class::Storage::TxnScopeGuard;
+package # Hide from pause for now - till we get it working
+ DBIx::Class::Storage::TxnScopeGuard;
use strict;
use warnings;
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage.pm 2008-03-01 04:47:07 UTC (rev 4112)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage.pm 2008-03-01 12:17:54 UTC (rev 4113)
@@ -262,7 +262,7 @@
sub txn_rollback { die "Virtual method!" }
-=for
+=for comment
=head2 txn_scope_guard
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class.pm 2008-03-01 04:47:07 UTC (rev 4112)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class.pm 2008-03-01 12:17:54 UTC (rev 4113)
@@ -24,7 +24,7 @@
# i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
# brain damage and presumably various other packaging systems too
-$VERSION = '0.08009';
+$VERSION = '0.08010';
sub MODIFY_CODE_ATTRIBUTES {
my ($class,$code, at attrs) = @_;
Modified: DBIx-Class/0.08/trunk/t/94versioning.t
===================================================================
--- DBIx-Class/0.08/trunk/t/94versioning.t 2008-03-01 04:47:07 UTC (rev 4112)
+++ DBIx-Class/0.08/trunk/t/94versioning.t 2008-03-01 12:17:54 UTC (rev 4113)
@@ -5,9 +5,9 @@
use File::Spec;
BEGIN {
- eval "use DBD::SQLite; use SQL::Translator 0.08;";
+ eval "use DBD::SQLite; use SQL::Translator 0.09;";
plan $@
- ? ( skip_all => 'needs DBD::SQLite and SQL::Translator 0.08 for testing' )
+ ? ( skip_all => 'needs DBD::SQLite and SQL::Translator 0.09 for testing' )
: ( tests => 6 );
}
More information about the Bast-commits
mailing list