1 -- 1. Turn some ints into bigints.
3 -- 2. Rename a constraint for consistency and accuracy (currently it may
4 -- have either of two different names).
6 \qecho One of the following DROPs will fail, so we do them
7 \qecho both outside of a transaction. Ignore the failure.
9 ALTER TABLE booking.resource_type
10 DROP CONSTRAINT brt_name_or_record_once_per_owner;
12 ALTER TABLE booking.resource_type
13 DROP CONSTRAINT brt_name_once_per_owner;
17 INSERT INTO config.upgrade_log (version) VALUES ('0421'); -- Scott McKellar
19 ALTER TABLE booking.resource_type
20 ALTER COLUMN record SET DATA TYPE bigint,
21 ADD CONSTRAINT brt_name_and_record_once_per_owner UNIQUE(owner, name, record);
23 ALTER TABLE container.biblio_record_entry_bucket_item
24 ALTER COLUMN target_biblio_record_entry SET DATA TYPE bigint;
26 -- Before we can embiggen the next one, we must drop a view
27 -- that depends on it (and recreate it later)
29 DROP VIEW IF EXISTS acq.acq_lineitem_lifecycle;
31 ALTER TABLE acq.lineitem
32 ALTER COLUMN eg_bib_id SET DATA TYPE bigint;
36 SELECT acq.create_acq_lifecycle( 'acq', 'lineitem' );
38 ALTER TABLE vandelay.queued_bib_record
39 ALTER COLUMN imported_as SET DATA TYPE bigint;
41 ALTER TABLE action.hold_copy_map
42 ALTER COLUMN id SET DATA TYPE bigint;