[Jifty-commit] r2669 - in jifty/trunk/lib/Jifty: .
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sat Jan 27 10:42:02 EST 2007
Author: audreyt
Date: Sat Jan 27 10:42:01 2007
New Revision: 2669
Modified:
jifty/trunk/lib/Jifty/Handle.pm
jifty/trunk/lib/Jifty/Script/Schema.pm
jifty/trunk/lib/Jifty/Upgrade.pm
Log:
* Change all tests for the literal Driver string "SQLite"
to a regex match to /SQLite/, in anticipation of fancy
drivers such as SVK::SQLite.
Modified: jifty/trunk/lib/Jifty/Handle.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Handle.pm (original)
+++ jifty/trunk/lib/Jifty/Handle.pm Sat Jan 27 10:42:01 2007
@@ -65,7 +65,7 @@
# legacy databases
my $db = $db_config->{'Database'};
- if ($db_config->{'Driver'} eq 'SQLite') {
+ if ($db_config->{'Driver'} =~ /SQLite/) {
$db = Jifty::Util->absolute_path($db);
}
Modified: jifty/trunk/lib/Jifty/Script/Schema.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Script/Schema.pm (original)
+++ jifty/trunk/lib/Jifty/Script/Schema.pm Sat Jan 27 10:42:01 2007
@@ -491,7 +491,7 @@
if ( $self->{'drop_database'} ) {
if ( $self->{'print'} ) {
print "DROP DATABASE $database;\n";
- } elsif ( $driver eq 'SQLite' ) {
+ } elsif ( $driver =~ /SQLite/ ) {
# Win32 complains when you try to unlink open DB
$handle->disconnect if $^O eq 'MSWin32';
unlink($database);
@@ -503,7 +503,7 @@
if ( $self->{'create_database'} ) {
if ( $self->{'print'} ) {
print "CREATE DATABASE $database;\n";
- } elsif ( $driver ne 'SQLite' ) {
+ } elsif ( $driver !~ /SQLite/ ) {
$handle->simple_query("CREATE DATABASE $database");
}
}
Modified: jifty/trunk/lib/Jifty/Upgrade.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Upgrade.pm (original)
+++ jifty/trunk/lib/Jifty/Upgrade.pm Sat Jan 27 10:42:01 2007
@@ -84,7 +84,7 @@
if ( $args{column} ) {
my $driver = Jifty->config->framework('Database')->{'Driver'};
- if ( $driver eq "SQLite" ) {
+ if ( $driver =~ /SQLite/ ) {
# Convert columns
my ($schema) = Jifty->handle->fetch_result("SELECT sql FROM sqlite_master WHERE tbl_name = '$table_name' AND type = 'table'");
More information about the Jifty-commit
mailing list