]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0799.state_field_required_toggle.sql
Stamping upgrade script for making state not required
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0799.state_field_required_toggle.sql
1 BEGIN;
2
3 SELECT evergreen.upgrade_deps_block_check('0799', :eg_version);
4
5 -- allow state to be null
6 ALTER TABLE actor.usr_address ALTER COLUMN state DROP NOT NULL;
7
8 -- create new YAOUS
9 INSERT into config.org_unit_setting_type
10     (name, grp, label, description, datatype)
11     VALUES (
12         'ui.patron.edit.au.state.require',
13         'gui',
14         oils_i18n_gettext(
15             'ui.patron.edit.au.state.require',
16             'Require State field on patron registration',
17             'coust',
18             'label'
19         ),
20         oils_i18n_gettext(
21             'ui.patron.edit.au.state.require',
22             'The State field will be required on the patron registration screen.',
23             'coust',
24             'description'
25         ),
26         'bool'
27     );
28
29 INSERT into config.org_unit_setting_type
30     (name, grp, label, description, datatype)
31     VALUES (
32         'ui.patron.edit.au.state.show',
33         'gui',
34         oils_i18n_gettext(
35             'ui.patron.edit.au.state.show',
36             'Show State field on patron registration',
37             'coust',
38             'label'
39         ),
40         oils_i18n_gettext(
41             'ui.patron.edit.au.state.show',
42             'The State field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.',
43             'coust',
44             'description'
45         ),
46         'bool'
47     );  
48
49 INSERT into config.org_unit_setting_type
50     (name, grp, label, description, datatype)
51     VALUES (
52         'ui.patron.edit.au.state.suggest',
53         'gui',
54         oils_i18n_gettext(
55             'ui.patron.edit.au.state.suggest',
56             'Suggest State field on patron registration',
57             'coust',
58             'label'
59         ),
60         oils_i18n_gettext(
61             'ui.patron.edit.au.state.suggest',
62             'The State field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.',
63             'coust',
64             'description'
65         ),
66         'bool'
67     );          
68
69 COMMIT;