]> git.donarmstrong.com Git - debbugs.git/commitdiff
complete documentation for --upgrade don/database_upgrade
authorDon Armstrong <don@donarmstrong.com>
Sat, 12 Sep 2020 19:58:48 +0000 (12:58 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sat, 12 Sep 2020 19:58:48 +0000 (12:58 -0700)
bin/debbugs-installsql
lib/Debbugs/DB/Util.pm

index ed407eba65b34e2bf66541ba72f8ef5b8751041e..d2aa7a9960164fc38ef234f0165e3fcfc6f11913 100755 (executable)
@@ -43,7 +43,8 @@ environmental variable (which this option overrides).
 
 =item B<--deployment-dir>
 
-Deployment directory (defaults to /usr/share/debbugs/sql/upgrade)
+Deployment directory (defaults to /usr/share/debbugs/sql/). This directory
+contains an upgrade subdirectory and scripts which perform the upgrade
 
 =item B<--debug, -d>
 
@@ -163,6 +164,10 @@ if ($options{current_version}) {
        }
     }
 } elsif ($options{install_version_storage}) {
+    if ($s->db_version > 1) {
+       print STDERR "Version storage is already installed, current version is > 1\n";
+       exit 1;
+    }
     # TODO Check if db_version already exists, and error out
     $s->sql_file_in_txn($options{deployment_dir}.'/version_storage.sql');
 }
index 0a072871c95c22cb71e23144dddcb804efd6f062..e2b8b638f8c8b4f94b8514a771984f2d7d4714d1 100644 (file)
@@ -136,13 +136,10 @@ sub upgrades_to_run {
                     $deployment_dir
                    );
     # sort the upgrades
-    use Data::Dumper;
-    print STDERR Dumper(@files);
     @files = sort {$a->{from} <=> $b->{from}}
        # strip out upgrades which don't need to be run
        grep {$_->{from} >= $current_version } @files;
 
-    print STDERR Dumper(@files);
     return @files;
 }