IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 17, 2008, 3:26:17 PM (17 years ago)
Author:
Paul Price
Message:

Attempt to fix following schema change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diff_inputs.pl

    r20461 r21033  
    2626
    2727my ($db_host, $db_name, $db_user, $db_pw); # Database details
    28 my ($diff_id);                  # Diff of interest
     28my ($diff_id, $skycell_id);     # Diff and skycell of interest
    2929my ($input);                    # Input list
    3030
     
    3535           'dbpass=s' => \$db_pw, # Database p/w
    3636           'diff_id=s' => \$diff_id, # Diff identifier
     37           'skycell_id=s' => \$skycell_id, # Skycell identifier
    3738           'input=s'  => \$input, # Input list to generate
    3839           ) or die "Unable to parse arguments.\n";
     
    5758    "     NULL AS stack_path_base" .
    5859    " FROM diffRun" .
    59     " JOIN diffInputSkyfile USING(diff_id, skycell_id)" .
     60    " JOIN diffInputSkyfile USING(diff_id)" .
    6061    " JOIN warpSkyfile USING(warp_id, skycell_id)" .
    61     " WHERE diff_id = $diff_id" .
    62     " UNION" .
     62    " WHERE diff_id = $diff_id";
     63$sql .= " AND skycell_id = $skycell_id" if defined $skycell_id;
     64$sql.= " UNION" .
    6365    " SELECT" .
    6466    "     NULL AS warp_path_base," .
    6567    "     stackSumSkyfile.path_base AS stack_path_base" .
    6668    " FROM diffRun" .
    67     " JOIN diffInputSkyfile USING(diff_id, skycell_id)" .
     69    " JOIN diffInputSkyfile USING(diff_id)" .
    6870    " JOIN stackSumSkyfile USING(stack_id)" .
    6971    " WHERE diff_id = $diff_id";
     72$sql .= " AND skycell_id = $skycell_id" if defined $skycell_id;
    7073
    7174
Note: See TracChangeset for help on using the changeset viewer.