1 -- Resolve some discrepancies in the auditor schema between a fresh
2 -- install and an upgraded database.
6 INSERT INTO config.upgrade_log (version) VALUES ('0413'); -- Scott McKellar
8 DROP VIEW auditor.actor_org_unit_lifecycle;
10 SELECT auditor.create_auditor_lifecycle( 'actor', 'org_unit' );
12 ALTER TABLE auditor.actor_usr_history
13 ALTER COLUMN claims_never_checked_out_count DROP DEFAULT;
15 DROP VIEW auditor.actor_usr_lifecycle;
17 SELECT auditor.create_auditor_lifecycle( 'actor', 'usr' );
19 DROP VIEW auditor.asset_call_number_lifecycle;
21 SELECT auditor.create_auditor_lifecycle( 'asset', 'call_number' );
23 DROP VIEW auditor.asset_copy_lifecycle;
25 SELECT auditor.create_auditor_lifecycle( 'asset', 'copy' );
27 DROP VIEW auditor.biblio_record_entry_lifecycle;
29 SELECT auditor.create_auditor_lifecycle( 'biblio', 'record_entry' );
33 -- Outside of transaction; failure is okay if the
34 -- index already exists
36 \qecho Creating some indexes outside of a transaction. If a CREATE
37 \qecho fails because the index already exists, ignore the failure.
39 CREATE INDEX aud_actor_usr_address_hist_id_idx
40 ON auditor.actor_usr_address_history ( id );
42 CREATE INDEX aud_actor_usr_hist_id_idx
43 ON auditor.actor_usr_history ( id );
45 CREATE INDEX aud_asset_cn_hist_creator_idx
46 ON auditor.asset_call_number_history ( creator );
48 CREATE INDEX aud_asset_cn_hist_editor_idx
49 ON auditor.asset_call_number_history ( editor );
51 CREATE INDEX aud_asset_cp_hist_creator_idx
52 ON auditor.asset_copy_history ( creator );
54 CREATE INDEX aud_asset_cp_hist_editor_idx
55 ON auditor.asset_copy_history ( editor );
57 CREATE INDEX aud_bib_rec_entry_hist_creator_idx
58 ON auditor.biblio_record_entry_history ( creator );
60 CREATE INDEX aud_bib_rec_entry_hist_editor_idx
61 ON auditor.biblio_record_entry_history ( editor );