[Bast-commits] r7696 - in DBIx-Class/0.08/trunk: . lib/DBIx
lib/DBIx/Class/Schema lib/DBIx/Class/Storage t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Fri Sep 18 18:09:05 GMT 2009
Author: ribasushi
Date: 2009-09-18 18:09:04 +0000 (Fri, 18 Sep 2009)
New Revision: 7696
Modified:
DBIx-Class/0.08/trunk/Makefile.PL
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/DBI.pm
DBIx-Class/0.08/trunk/t/86sqlt.t
DBIx-Class/0.08/trunk/t/94versioning.t
DBIx-Class/0.08/trunk/t/99dbic_sqlt_parser.t
Log:
This code belogs in Storage::DBI
Modified: DBIx-Class/0.08/trunk/Makefile.PL
===================================================================
--- DBIx-Class/0.08/trunk/Makefile.PL 2009-09-18 12:53:33 UTC (rev 7695)
+++ DBIx-Class/0.08/trunk/Makefile.PL 2009-09-18 18:09:04 UTC (rev 7696)
@@ -62,7 +62,7 @@
my %force_requires_if_author = (
%replication_requires,
- # when changing also adjust $DBIx::Class::minimum_sqlt_version
+ # when changing also adjust $DBIx::Class::Storage::DBI::minimum_sqlt_version
'SQL::Translator' => '0.11002',
# 'Module::Install::Pod::Inherit' => '0.01',
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm 2009-09-18 12:53:33 UTC (rev 7695)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm 2009-09-18 18:09:04 UTC (rev 7696)
@@ -520,11 +520,11 @@
return;
}
- $self->throw_exception($self->_sqlt_version_error)
- if (not $self->_sqlt_version_ok);
+ $self->throw_exception($self->storage->_sqlt_version_error)
+ if (not $self->storage->_sqlt_version_ok);
- my $db_tr = SQL::Translator->new({
- add_drop_table => 1,
+ my $db_tr = SQL::Translator->new({
+ add_drop_table => 1,
parser => 'DBI',
parser_args => { dbh => $self->storage->dbh }
});
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2009-09-18 12:53:33 UTC (rev 7695)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2009-09-18 18:09:04 UTC (rev 7696)
@@ -14,6 +14,11 @@
use Scalar::Util();
use List::Util();
+# what version of sqlt do we require if deploy() without a ddl_dir is invoked
+# when changing also adjust the corresponding author_require in Makefile.PL
+my $minimum_sqlt_version = '0.11002';
+
+
__PACKAGE__->mk_group_accessors('simple' =>
qw/_connect_info _dbi_connect_info _dbh _sql_maker _sql_maker_opts _conn_pid
_conn_tid transaction_depth _dbh_autocommit _driver_determined savepoints/
@@ -2618,6 +2623,33 @@
return;
}
+# SQLT version handling
+{
+ my $_sqlt_version_ok; # private
+ my $_sqlt_version_error; # private
+
+ sub _sqlt_version_ok {
+ if (!defined $_sqlt_version_ok) {
+ eval "use SQL::Translator $minimum_sqlt_version";
+ if ($@) {
+ $_sqlt_version_ok = 0;
+ $_sqlt_version_error = $@;
+ }
+ else {
+ $_sqlt_version_ok = 1;
+ }
+ }
+ return $_sqlt_version_ok;
+ }
+
+ sub _sqlt_version_error {
+ shift->_sqlt_version_ok unless defined $_sqlt_version_ok;
+ return $_sqlt_version_error;
+ }
+
+ sub _sqlt_minimum_version { $minimum_sqlt_version };
+}
+
sub DESTROY {
my $self = shift;
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class.pm 2009-09-18 12:53:33 UTC (rev 7695)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class.pm 2009-09-18 18:09:04 UTC (rev 7696)
@@ -24,15 +24,10 @@
# Always remember to do all digits for the version even if they're 0
# 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.08111';
$VERSION = eval $VERSION; # numify for warning-free dev releases
-# what version of sqlt do we require if deploy() without a ddl_dir is invoked
-# when changing also adjust the corresponding author_require in Makefile.PL
-my $minimum_sqlt_version = '0.11002';
-
sub MODIFY_CODE_ATTRIBUTES {
my ($class,$code, at attrs) = @_;
$class->mk_classdata('__attr_cache' => {})
@@ -48,34 +43,6 @@
return $@ ? $cache : { %$cache, %$rest };
}
-# SQLT version handling
-{
- my $_sqlt_version_ok; # private
- my $_sqlt_version_error; # private
-
- sub _sqlt_version_ok {
- if (!defined $_sqlt_version_ok) {
- eval "use SQL::Translator $minimum_sqlt_version";
- if ($@) {
- $_sqlt_version_ok = 0;
- $_sqlt_version_error = $@;
- }
- else {
- $_sqlt_version_ok = 1;
- }
- }
- return $_sqlt_version_ok;
- }
-
- sub _sqlt_version_error {
- shift->_sqlt_version_ok unless defined $_sqlt_version_ok;
- return $_sqlt_version_error;
- }
-
- sub _sqlt_minimum_version { $minimum_sqlt_version };
-}
-
-
1;
=head1 NAME
Modified: DBIx-Class/0.08/trunk/t/86sqlt.t
===================================================================
--- DBIx-Class/0.08/trunk/t/86sqlt.t 2009-09-18 12:53:33 UTC (rev 7695)
+++ DBIx-Class/0.08/trunk/t/86sqlt.t 2009-09-18 18:09:04 UTC (rev 7696)
@@ -6,10 +6,10 @@
use DBICTest;
BEGIN {
- require DBIx::Class;
+ require DBIx::Class::Storage::DBI;
plan skip_all =>
- 'Test needs SQL::Translator ' . DBIx::Class->_sqlt_minimum_version
- if not DBIx::Class->_sqlt_version_ok;
+ 'Test needs SQL::Translator ' . DBIx::Class::Storage::DBI->_sqlt_minimum_version
+ if not DBIx::Class::Storage::DBI->_sqlt_version_ok;
}
my $schema = DBICTest->init_schema (no_deploy => 1);
Modified: DBIx-Class/0.08/trunk/t/94versioning.t
===================================================================
--- DBIx-Class/0.08/trunk/t/94versioning.t 2009-09-18 12:53:33 UTC (rev 7695)
+++ DBIx-Class/0.08/trunk/t/94versioning.t 2009-09-18 18:09:04 UTC (rev 7696)
@@ -16,10 +16,10 @@
plan skip_all => 'Set $ENV{DBICTEST_MYSQL_DSN}, _USER and _PASS to run this test'
unless ($dsn);
- require DBIx::Class;
+ require DBIx::Class::Storage::DBI;
plan skip_all =>
- 'Test needs SQL::Translator ' . DBIx::Class->_sqlt_minimum_version
- if not DBIx::Class->_sqlt_version_ok;
+ 'Test needs SQL::Translator ' . DBIx::Class::Storage::DBI->_sqlt_minimum_version
+ if not DBIx::Class::Storage::DBI->_sqlt_version_ok;
}
my $version_table_name = 'dbix_class_schema_versions';
Modified: DBIx-Class/0.08/trunk/t/99dbic_sqlt_parser.t
===================================================================
--- DBIx-Class/0.08/trunk/t/99dbic_sqlt_parser.t 2009-09-18 12:53:33 UTC (rev 7695)
+++ DBIx-Class/0.08/trunk/t/99dbic_sqlt_parser.t 2009-09-18 18:09:04 UTC (rev 7696)
@@ -6,10 +6,10 @@
use DBICTest;
BEGIN {
- require DBIx::Class;
+ require DBIx::Class::Storage::DBI;
plan skip_all =>
- 'Test needs SQL::Translator ' . DBIx::Class->_sqlt_minimum_version
- if not DBIx::Class->_sqlt_version_ok;
+ 'Test needs SQL::Translator ' . DBIx::Class::Storage::DBI->_sqlt_minimum_version
+ if not DBIx::Class::Storage::DBI->_sqlt_version_ok;
}
my $schema = DBICTest->init_schema();
More information about the Bast-commits
mailing list