IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 15, 2009, 11:37:32 AM (17 years ago)
Author:
bills
Message:

Add a new table to the database dbversion where we will store the
schema version number. In -exportrun save the version in the output files.
Then in -importrun insure that the input file version matches the schema.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/chiptool.c

    r25840 r25851  
    13771377  }
    13781378
     1379  if (!pxExportVersion(config, f)) {
     1380    psError(PS_ERR_UNKNOWN, false, "failed to write dbversion output file");
     1381    return false;
     1382  }
     1383
    13791384  psMetadata *where = psMetadataAlloc();
    13801385  PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
     
    14681473    psVector *identifiers = psVectorAllocEmpty(16, PS_TYPE_U64); // Identifiers inserted
    14691474
     1475    psMetadataIterator *iter = psMetadataIteratorAlloc(input, PS_LIST_HEAD, NULL);       // Iterator
     1476
     1477    if (!pxCheckImportVersion(config, input)) {
     1478        psError(PS_ERR_UNKNOWN, false, "pxCheckImportVersion failed");
     1479        return false;
     1480    }
     1481    // first item is the dbversion, skip it
     1482    psMetadataItem *dbversion =  psMetadataGetAndIncrement(iter);
     1483    (void) dbversion;
     1484
    14701485    if (!psDBTransaction(config->dbh)) {
    14711486        psError(PS_ERR_UNKNOWN, false, "database error");
     
    14731488    }
    14741489
    1475     psMetadataIterator *iter = psMetadataIteratorAlloc(input, PS_LIST_HEAD, NULL);       // Iterator
    14761490    psMetadataItem *item;               // Item from iteration
    14771491    while ((item = psMetadataGetAndIncrement(iter))) {
Note: See TracChangeset for help on using the changeset viewer.