[Bast-commits] r9485 -
DBIx-Class/0.08/branches/dbicadmin-non-versioned/lib/DBIx/Class
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Mon May 31 17:24:54 GMT 2010
Author: ribasushi
Date: 2010-05-31 18:24:54 +0100 (Mon, 31 May 2010)
New Revision: 9485
Modified:
DBIx-Class/0.08/branches/dbicadmin-non-versioned/lib/DBIx/Class/Admin.pm
Log:
Cleanup debug output
Modified: DBIx-Class/0.08/branches/dbicadmin-non-versioned/lib/DBIx/Class/Admin.pm
===================================================================
--- DBIx-Class/0.08/branches/dbicadmin-non-versioned/lib/DBIx/Class/Admin.pm 2010-05-31 16:59:48 UTC (rev 9484)
+++ DBIx-Class/0.08/branches/dbicadmin-non-versioned/lib/DBIx/Class/Admin.pm 2010-05-31 17:24:54 UTC (rev 9485)
@@ -348,6 +348,7 @@
sub upgrade {
my ($self) = @_;
my $schema = $self->schema();
+
if (!$schema->get_db_version()) {
# schema is unversioned
$schema->throw_exception ("Could not determin current schema version, please either install() or deploy().\n");
@@ -380,9 +381,9 @@
$version ||= $self->version();
if (!$schema->get_db_version() ) {
# schema is unversioned
- print "Going to install schema version\n";
+ print "Going to install schema version\n" if (!$self->quiet);
my $ret = $schema->install($version);
- print "retun is $ret\n";
+ print "return is $ret\n" if (!$self->quiet);
}
elsif ($schema->get_db_version() and $self->force ) {
carp "Forcing install may not be a good idea";
@@ -541,12 +542,14 @@
sub _confirm {
my ($self) = @_;
- print "Are you sure you want to do this? (type YES to confirm) \n";
+
# mainly here for testing
return 1 if ($self->meta->get_attribute('_confirm')->get_value($self));
+
+ print "Are you sure you want to do this? (type YES to confirm) \n";
my $response = <STDIN>;
- return 1 if ($response=~/^YES/);
- return;
+
+ return ($response=~/^YES/);
}
sub _find_stanza {
More information about the Bast-commits
mailing list