From a8941daa39ac9429927dd720565949ca266ab416 Mon Sep 17 00:00:00 2001 From: Chad Trabant Date: Wed, 28 Feb 2018 16:35:19 -0800 Subject: [PATCH] Update time series index database schema to version 1.1 --- ChangeLog | 6 +++++- src/mseedindex.c | 33 ++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c9126b..ba00fb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ -2018.059: +2018.059: 2.7 - Update SQLite to 3.22.0. + - Update time series index database schema to version 1.1. + This schema change includes the addition of a 'version' field, + which is unpopulated by this version of the software but will + be populated in the future. 2017.283: 2.6 - Update libmseed to 2.19.5, with fix for leap second calculation. diff --git a/src/mseedindex.c b/src/mseedindex.c index a4f3e57..8eab36d 100644 --- a/src/mseedindex.c +++ b/src/mseedindex.c @@ -30,23 +30,24 @@ * * Field Name Type * ------------ ------------ - * id serial -- Auto-incrementing - * network character varying(2) - * station character varying(5) - * location character varying(2) - * channel character varying(3) - * quality character varying(1) + * id bigserial -- Auto-incrementing + * network character text + * station character text + * location character text + * channel character text + * quality character text + * version smallint, * starttime timestamp with time zone -- Earliest sample time * endtime timestamp with time zone -- Latest sample time - * samplerate numeric(10,6) - * filename character varying(256) - * byteoffset numeric(15,0) - * bytes numeric(15,0) - * hash character varying(64) + * samplerate numeric + * filename character text + * byteoffset bigint + * bytes bigint + * hash character text * timeindex hstore -- List of time=>offset pairs using epoch times * timespans numrange[] -- Array of numrange values containing epoch times - * timerates numeric(10,6)[] -- Array of sample rates corresponding to timespans - * format character varying(8) -- NULL means miniSEED + * timerates numeric[] -- Array of sample rates corresponding to timespans + * format character text -- NULL means miniSEED * filemodtime timestamp with time zone * updated timestamp with time zone * scanned timestamp with time zone @@ -60,6 +61,7 @@ * location TEXT * channel TEXT * quality TEXT + * version INTEGER * starttime TEXT -- Date-time in format YYYY-MM-DDTHH:MM:SS.ssssss * endtime TEXT -- Date-time in format YYYY-MM-DDTHH:MM:SS.ssssss * samplerate REAL @@ -81,7 +83,7 @@ * * Written by Chad Trabant, IRIS Data Management Center. * - * modified 2017.123 + * modified 2018.059 ***************************************************************************/ #define _GNU_SOURCE @@ -106,7 +108,7 @@ #include "md5.h" -#define VERSION "2.6" +#define VERSION "2.7" #define PACKAGE "mseedindex" static flag verbose = 0; @@ -1114,6 +1116,7 @@ SyncSQLite (void) "location TEXT," "channel TEXT," "quality TEXT," + "version INTEGER," "starttime TEXT," "endtime TEXT," "samplerate REAL,"