From 72b81cbb48658892530cce291751a96e6285971d Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Sun, 29 May 2011 04:34:48 +0000 Subject: [PATCH] CSPACE-4052: Initial ID service 'load ID generators' script for PostgreSQL. --- .../db/postgresql/load_id_generators.sql | 562 ++++++++++++++++++ 1 file changed, 562 insertions(+) create mode 100644 services/id/service/src/main/resources/db/postgresql/load_id_generators.sql diff --git a/services/id/service/src/main/resources/db/postgresql/load_id_generators.sql b/services/id/service/src/main/resources/db/postgresql/load_id_generators.sql new file mode 100644 index 000000000..06390f044 --- /dev/null +++ b/services/id/service/src/main/resources/db/postgresql/load_id_generators.sql @@ -0,0 +1,562 @@ +/* + * This document is a part of the source code and related artifacts + * for CollectionSpace, an open source collections management system + * for museums and related institutions: + * + * http://www.collectionspace.org + * http://wiki.collectionspace.org + * + * Copyright © 2009 Regents of the University of California + * + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * https://source.collectionspace.org/collection-space/LICENSE.txt + */ + +/* + * load_id_generators_table.sql + * + * Loads a default set of data into the "id_generators" table, + * used by the ID Service. + * + * $LastChangedRevision$ + * $LastChangedDate$ + */ + +/* + * Note: in the priority column, values range from '1' (highest) + * to '9' (lowest). + */ + +/* + * NOTE: In the id_generator_state column, for numeric sequence parts + * whose first generated value should start at the initial value + * (such as '1'), enter '-1' for the + * + * Otherwise, the first generated value will be the next value + * in the sequence after the initial value (e.g. '2', if the + * initial value is '1'). + */ + +-- (Only works with scripts executed by the 'psql' client.) +\c cspace; + +-- ACCESSION_LOT_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('1a67470b-19b1-4ae3-88d4-2a0aa936270e', + 'Accession Activity Number', + 'Identifies accession activities, in which a lot of +one or more collection objects is acquired by the institution.', + '9', + NULL, +' + + + + + + . + . + + + 6 + 1 + -1 + + +'); + +-- ACCESSION_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('9dd92952-c384-44dc-a736-95e435c1759c', + 'Accession Number', + 'Identifies individual collection objects formally +acquired by the institution. Used for collection objects +without parts.', + '9', + '', +' + + + + + + . + . + + + 6 + 1 + -1 + + + . + . + + + 6 + 1 + -1 + + +'); + +-- ARCHIVES_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('70586d30-9dca-4a07-a3a2-1976fe898028', + 'Archives Number', + 'Identifies archives-related accession activities, +in which a lot of one or more collection objects is formally +acquired for the archives.', + '9', + '', +' + + + AR + AR + + + + + + . + . + + + 6 + 1 + -1 + + +'); + +-- EVALUATION_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('d2d80822-25c7-4c7c-a105-fc40cdb0c50f', + 'Evaluation Number', + 'Identifies evaluation-related intake activities, +in which a lot of one or more collection objects is formally +acquired for evaluation.', + '9', + '', +' + + + EV + EV + + + + + + . + . + + + 6 + 1 + -1 + + +'); + +-- INTAKE_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('8088cfa5-c743-4824-bb4d-fb11b12847f7', + 'Intake Number', + 'Identifies intake activities, in which a lot of one +or more collection objects enters the institution.', + '9', + '', +' + + + IN + IN + + + + + + . + . + + + 6 + 1 + -1 + + +'); + +-- INTAKE_OBJECT_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('a91db555-5c53-4996-9918-6712351397a0', + 'Intake Object Number', + 'Identifies individual collection objects that enter +the institution through intake activities, before they are +either returned to their owner or formally acquired.', + '9', + '', +' + + + IN + IN + + + + + + . + . + + + 6 + 1 + -1 + + + . + . + + + 6 + 1 + -1 + + +'); + +-- LIBRARY_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('80fedaf6-1647-4f30-9f53-a75a3cac2ffd', + 'Library Number', + 'Identifies library-related accession activities, +in which a lot of one or more collection objects is +formally acquired for the library.', + '9', + '', +' + + + LIB + LIB + + + + + + . + . + + + 6 + 1 + -1 + + +'); + +-- LOANS_IN_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('ed87e7c6-0678-4f42-9d33-f671835586ef', + 'Loan In Number', + 'Identifies activities in which collection objects are +received on loan.', + '9', + '', +' + + + LI + LI + + + + + + . + . + + + 6 + 1 + -1 + + + . + . + + + 6 + 1 + -1 + + +'); + +-- LOANS_OUT_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('4b984865-f93d-4481-b874-3dba863ec589', + 'Loan Out Number', + 'Identifies activities in which collection objects are +loaned out of the institution.', + '9', + '', +' + + + LO + LO + + + + + + . + . + + + 6 + 1 + -1 + + + . + . + + + 6 + 1 + -1 + + +'); + +-- MEDIA_RESOURCE_IDENTIFICATION_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('cd91d8b8-f346-4925-a425-93e02bd1c5c9', + 'Media Resource Identification Number', + 'Unambiguously identifies a media resource within a given context. +Recommended best practice is to identify the resource by means of a string +conforming to a formal identification system.', + '9', + '', +' + + + MR + MR + + + + + + . + . + + + 6 + 1 + -1 + + + . + . + + + 6 + 1 + -1 + + +'); + + +-- MOVEMENT_REFERENCE_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('49ca9d8d-7136-47ff-a70e-4a47b9038b70', + 'Movement Reference Number', + 'Identifies a movement of a collection object or a group of collection objects.', + '9', + '', +' + + + MV + MV + + + + + + . + . + + + 6 + 1 + -1 + + +'); + +-- OBJECT_EXIT_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('d4eea707-d473-4367-853a-728fbcd9be17', + 'Object Exit Number', + 'Identifies an exit from the museum of collection objects, via +transfer or destruction, and the deaccessioning of those objects +from the museum''s collections.', + '9', + '', +' + + + EX + EX + + + + + + . + . + + + 6 + 1 + -1 + + +'); + +-- STUDY_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('0518132e-dd8c-4773-8fa9-07c9af4444ee', + 'Study Number', + 'Identifies study-related intake activities, +in which a lot of one or more collection objects is +formally acquired for study.', + '9', + '', +' + + + ST + ST + + + + + + . + . + + + 6 + 1 + -1 + + +'); + +-- TRANSFER_OF_TITLE_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('c597a209-5954-4fa6-bf3f-f83c1a0ad586', + 'Transfer of Title Number', + 'Identifies the transfer of title for one or more collection objects +to a receiving institution.', + '9', + '', +' + + + TT + TT + + + + + + . + . + + + 6 + 1 + -1 + + +'); + +-- UUID + +/* + * Note: these are Type 4 UUIDs, whose generation is based on + * random and pseudo-random parts. + */ + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + VALUES + ('1fa40353-05b8-4ae6-82a6-44a18b4f3c12', + 'UUID', + 'Universally unique identifiers (UUIDs), which may be +used for CollectionSpace IDs (CSIDs) and any other relevant +purposes.', + '9', + '', +' + + + + +'); + -- 2.47.3