]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/version-upgrade/3.6.0-3.6.1-upgrade-db.sql
LP 2061136 follow-up: ng lint --fix
[Evergreen.git] / Open-ILS / src / sql / Pg / version-upgrade / 3.6.0-3.6.1-upgrade-db.sql
1 --Upgrade Script for 3.6.0 to 3.6.1
2 \set eg_version '''3.6.1'''
3 BEGIN;
4 INSERT INTO config.upgrade_log (version, applied_to) VALUES ('3.6.1', :eg_version);
5
6 SELECT evergreen.upgrade_deps_block_check('1241', :eg_version);
7
8 SET CONSTRAINTS ALL IMMEDIATE; -- to address "pending trigger events" error
9
10 -- Dedupe the table before applying the script.  Preserve the original to allow the admin to delete it manually later.
11 CREATE TABLE reporter.schedule_original (LIKE reporter.schedule);
12 INSERT INTO reporter.schedule_original SELECT * FROM reporter.schedule;
13 TRUNCATE reporter.schedule;
14 INSERT INTO reporter.schedule (SELECT DISTINCT ON (report, folder, runner, run_time) id, report, folder, runner, run_time, start_time, complete_time, email, excel_format, html_format, csv_format, chart_pie, chart_bar, chart_line, error_code, error_text FROM reporter.schedule_original);
15 \qecho NOTE: This has created a backup of the original reporter.schedule
16 \qecho table, named reporter.schedule_original.  Once you are sure that everything
17 \qecho works as expected, you can delete that table by issuing the following:
18 \qecho
19 \qecho  'DROP TABLE reporter.schedule_original;'
20 \qecho
21
22 -- Explicitly supply the name because it is referenced in clark-kent.pl
23 CREATE UNIQUE INDEX rpt_sched_recurrence_once_idx ON reporter.schedule (report,folder,runner,run_time,COALESCE(email,''));
24
25
26
27 -- check whether patch can be applied
28 SELECT evergreen.upgrade_deps_block_check('1242', :eg_version);
29
30 -- Long Overdue
31 UPDATE config.org_unit_setting_type
32 SET description = oils_i18n_gettext(
33         'ui.circ.items_out.longoverdue',
34 'Value is a numeric code, describing: A. In which tab ("Items Checked Out", '||
35 'or "Other/Special Circulations") the circulation '||
36 'should appear while checked out, and B. Whether the circulation should '||
37 'continue to appear in the "Other" tab when checked in with '||
38 'oustanding fines.  '||
39 '1 = (A) "Items", (B) "Other".  2 = (A) "Other", (B) "Other".  ' ||
40 '5 = (A) "Items", (B) do not display.  6 = (A) "Other", (B) do not display.',
41         'coust',
42         'description'
43     )
44 WHERE NAME = 'ui.circ.items_out.longoverdue';
45
46 -- Lost
47 UPDATE config.org_unit_setting_type
48 SET description = oils_i18n_gettext(
49         'ui.circ.items_out.lost',
50 'Value is a numeric code, describing: A. In which tab ("Items Checked Out", '||
51 'or "Other/Special Circulations") the circulation '||
52 'should appear while checked out, and B. Whether the circulation should '||
53 'continue to appear in the "Other" tab when checked in with '||
54 'oustanding fines.  '||
55 '1 = (A) "Items", (B) "Other".  2 = (A) "Other", (B) "Other".  ' ||
56 '5 = (A) "Items", (B) do not display.  6 = (A) "Other", (B) do not display.',
57         'coust',
58         'description'
59     )
60 WHERE NAME = 'ui.circ.items_out.lost';
61
62 -- Claims Returned
63 UPDATE config.org_unit_setting_type
64 SET description = oils_i18n_gettext(
65         'ui.circ.items_out.claimsreturned',
66 'Value is a numeric code, describing: A. In which tab ("Items Checked Out", '||
67 'or "Other/Special Circulations") the circulation '||
68 'should appear while checked out, and B. Whether the circulation should '||
69 'continue to appear in the "Other" tab when checked in with '||
70 'oustanding fines.  '||
71 '1 = (A) "Items", (B) "Other".  2 = (A) "Other", (B) "Other".  ' ||
72 '5 = (A) "Items", (B) do not display.  6 = (A) "Other", (B) do not display.',
73         'coust',
74         'description'
75     )
76 WHERE NAME = 'ui.circ.items_out.claimsreturned';
77
78 COMMIT;
79
80 -- Update auditor tables to catch changes to source tables.
81 --   Can be removed/skipped if there were no schema changes.
82 SELECT auditor.update_auditors();