[OPEN-ILS-DEV] 2.1 RC2 upgrade script testing

Ben Shum bshum at biblio.org
Sat Aug 20 10:05:29 EDT 2011


Hi Mike,

I think this approach will work great, unless the site in question
doesn't have the correct ID values appropriate to the code.  In our
case, since we had identified some missing permissions didn't exist yet
in 2.0, but required it before the community had added them, something
like "MARK_ITEMS_MISSING_PIECES" was given an ID on our system of 1003
(a custom ID) and therefore this script couldn't match and find it.

For fun though, I changed the last left join to match on "code" instead
of "id" and this allowed the script to proceed fully, leaving the custom
ID's we used intact while inserting the rest of the new permissions. 
Ideally though, I should modify our system to match the
community-selected IDs as they become known.  I imagine that they're
given a particular ID for a reason so that they can be assigned to
specific default permission groups later on?

Thanks again!

-- Ben

On 08/19/2011 03:52 PM, Mike Rylander wrote:
> hrm... how about:
>
> INSERT INTO permission.perm_list
>     SELECT  np.*
>       FROM  (VALUES
>                 (485, 'CREATE_VOLUME_SUFFIX', oils_i18n_gettext(485,
> 'Create suffix label definition.', 'ppl', 'description'))
>                 ,(486, 'UPDATE_VOLUME_SUFFIX', oils_i18n_gettext(486,
> 'Update suffix label definition.', 'ppl', 'description'))
>                 ,(487, 'DELETE_VOLUME_SUFFIX', oils_i18n_gettext(487,
> 'Delete suffix label definition.', 'ppl', 'description'))
>                 ,(488, 'CREATE_VOLUME_PREFIX', oils_i18n_gettext(488,
> 'Create prefix label definition.', 'ppl', 'description'))
>                 ,(489, 'UPDATE_VOLUME_PREFIX', oils_i18n_gettext(489,
> 'Update prefix label definition.', 'ppl', 'description'))
>                 ,(490, 'DELETE_VOLUME_PREFIX', oils_i18n_gettext(490,
> 'Delete prefix label definition.', 'ppl', 'description'))
>                 ,(491, 'CREATE_MONOGRAPH_PART', oils_i18n_gettext(491,
> 'Create monograph part definition.', 'ppl', 'description'))
>                 ,(492, 'UPDATE_MONOGRAPH_PART', oils_i18n_gettext(492,
> 'Update monograph part definition.', 'ppl', 'description'))
>                 ,(493, 'DELETE_MONOGRAPH_PART', oils_i18n_gettext(493,
> 'Delete monograph part definition.', 'ppl', 'description'))
>                 ,(494, 'ADMIN_CODED_VALUE', oils_i18n_gettext(494,
> 'Create/Update/Delete SVF Record Attribute Coded Value Map', 'ppl',
> 'description'))
>                 ,(495, 'ADMIN_SERIAL_ITEM', oils_i18n_gettext(495,
> 'Create/Retrieve/Update/Delete Serial Item', 'ppl', 'description'))
>                 ,(496, 'ADMIN_SVF', oils_i18n_gettext(496,
> 'Create/Update/Delete SVF Record Attribute Defintion', 'ppl',
> 'description'))
>                 ,(497, 'CREATE_BIB_PTYPE', oils_i18n_gettext(497,
> 'Create Bibliographic Record Peer Type', 'ppl', 'description'))
>                 ,(498, 'CREATE_PURCHASE_REQUEST',
> oils_i18n_gettext(498, 'Create User Purchase Request', 'ppl',
> 'description'))
>                 ,(499, 'DELETE_BIB_PTYPE', oils_i18n_gettext(499,
> 'Delete Bibliographic Record Peer Type', 'ppl', 'description'))
>                 ,(500, 'MAP_MONOGRAPH_PART', oils_i18n_gettext(500,
> 'Create/Update/Delete Copy Monograph Part Map', 'ppl', 'description'))
>                 ,(501, 'MARK_ITEM_MISSING_PIECES',
> oils_i18n_gettext(501, 'Allows the Mark Item Missing Pieces action.',
> 'ppl', 'description'))
>                 ,(502, 'UPDATE_BIB_PTYPE', oils_i18n_gettext(502,
> 'Update Bibliographic Record Peer Type', 'ppl', 'description'))
>                 ,(503, 'UPDATE_HOLD_REQUEST_TIME',
> oils_i18n_gettext(503, 'Allows editing of a hold''s request time,
> and/or its Cut-in-line/Top-of-queue flag.', 'ppl', 'description'))
>                 ,(504, 'UPDATE_PICKLIST', oils_i18n_gettext(504,
> 'Allows update/re-use of an acquisitions pick/selection list.', 'ppl',
> 'description'))
>                 ,(505, 'UPDATE_WORKSTATION', oils_i18n_gettext(505,
> 'Allows update of a workstation during workstation registration
> override.', 'ppl', 'description'))
>                 ,(506, 'VIEW_USER_SETTING_TYPE',
> oils_i18n_gettext(506, 'Allows viewing of configurable user setting
> types.', 'ppl', 'description'))
>             ) np(id,code,description)
>             LEFT JOIN permission.perm_list pl USING (id)
>       WHERE pl.id IS NULL;

-- 
Benjamin Shum
Open Source Software Coordinator
Bibliomation, Inc.
32 Crest Road
Middlebury, CT 06762
203-577-4070, ext. 113



More information about the Open-ils-dev mailing list