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");
$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";
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 {