CONSTRAINT cap_type CHECK ( type in
( 'basic', 'supplement', 'index' )),
create_date TIMESTAMPTZ NOT NULL DEFAULT now(),
+ start_date TIMESTAMPTZ NOT NULL DEFAULT now(),
+ end_date TIMESTAMPTZ,
active BOOL NOT NULL DEFAULT FALSE,
pattern_code TEXT NOT NULL, -- must contain JSON
enum_1 TEXT,
record_entry BIGINT REFERENCES serial.record_entry (id)
ON DELETE SET NULL
DEFERRABLE INITIALLY DEFERRED,
+ summary_method TEXT CONSTRAINT sdist_summary_method_check
+ CHECK (summary_method IS NULL
+ OR summary_method IN ( 'add_to_sre',
+ 'merge_with_sre', 'use_sre_only',
+ 'use_sdist_only')),
subscription INT NOT NULL
REFERENCES serial.subscription (id)
ON DELETE CASCADE
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
generated_coverage TEXT NOT NULL,
- textual_holdings TEXT
+ textual_holdings TEXT,
+ show_generated BOOL NOT NULL DEFAULT TRUE
);
CREATE INDEX serial_basic_summary_dist_idx ON serial.basic_summary (distribution);
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
generated_coverage TEXT NOT NULL,
- textual_holdings TEXT
+ textual_holdings TEXT,
+ show_generated BOOL NOT NULL DEFAULT TRUE
);
CREATE INDEX serial_supplement_summary_dist_idx ON serial.supplement_summary (distribution);
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
generated_coverage TEXT NOT NULL,
- textual_holdings TEXT
+ textual_holdings TEXT,
+ show_generated BOOL NOT NULL DEFAULT TRUE
);
CREATE INDEX serial_index_summary_dist_idx ON serial.index_summary (distribution);
--- /dev/null
+-- serials schema tweaks
+
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0403'); -- dbwells via miker
+
+------- caption_and_pattern changes
+ALTER TABLE serial.caption_and_pattern
+ADD COLUMN start_date TIMESTAMP WITH TIME ZONE DEFAULT NOW();
+
+ALTER TABLE serial.caption_and_pattern
+ADD COLUMN end_date TIMESTAMP WITH TIME ZONE;
+
+
+------- *_summary changes
+ALTER TABLE serial.basic_summary
+ADD COLUMN show_generated BOOL NOT NULL DEFAULT TRUE;
+
+ALTER TABLE serial.supplement_summary
+ADD COLUMN show_generated BOOL NOT NULL DEFAULT TRUE;
+
+ALTER TABLE serial.index_summary
+ADD COLUMN show_generated BOOL NOT NULL DEFAULT TRUE;
+
+
+------- distribution changes
+ALTER TABLE serial.distribution
+
+ADD COLUMN summary_method TEXT CONSTRAINT summary_method_check CHECK (
+ summary_method IS NULL
+ OR summary_method IN ( 'add_to_sre',
+ 'merge_with_sre', 'use_sre_only',
+ 'use_sdist_only'));
+
+COMMIT;