make biblio_record_entry be biblio_record_entry_legacy
[migration-tools.git] / mig-bin / mig-stagebibs
index fb76b0c..5febc42 100755 (executable)
@@ -95,7 +95,7 @@ while(my $line = <$xml>) {
        if ($line =~ /^<\/?collection/) { next; }
        chomp $line;
        $record = $record . $line;
-       if ($line =~ /^<\/record/) {
+       if ($line =~ /<\/record>$/) {
                stage_record($dbh,$record,$source); 
                $record = '';
                $i++;
@@ -104,6 +104,7 @@ while(my $line = <$xml>) {
 }
 close $xml;
 
+if ($i == 0) { print "No XML was processed, are you sure this is an XML file?\n"; }
 print "Finis.\n";
 
 # beyond here be functions 
@@ -118,6 +119,7 @@ sub create_child_bre {
         IF t = FALSE THEN
             PERFORM migration_tools.build_specific_base_staging_table ('$MIGSCHEMA','biblio.record_entry');
         END IF;
+               ALTER TABLE biblio_record_entry RENAME TO biblio_record_entry_legacy;
         END \$\$;");
 
     return ();