Jira Legacy |
---|
server | System Jira |
---|
serverId | 01505d01-b853-3c2e-90f1-ee9b165564fc |
---|
key | MODQM-311 |
---|
|
...
Settings application UI preview:
Endpoints:
Code Block |
---|
theme | DJango |
---|
borderStyle | dashed |
---|
title | Authority Source File HRID Example |
---|
collapse | true |
---|
|
{
"id": "cb58492d-018e-442d-9ce3-35aabfc524aa",
"prefix": "loc",
"hrid": "000000001"
} |
POST: /authority-source-files
New query parameter: startNumber (default = 1)
Code Block |
---|
theme | DJango |
---|
borderStyle | dashed |
---|
title | Authority Source File SchemastartNumber parameter schema |
---|
collapse | true |
---|
|
"startNumber": {
"description": "The number from which to start generating HRIDs",
"type": "integer",
"minimum": 1,
"maximum": 99999999999
} |
...
There is a similar approach that works already in the mod-inventory-storage. It generates Hrid numbers for Instances, Holdings, and Item records, and can be configured from UI (Settings → Inventory → Hrid handling);
The problem here is that we will create new sequences in Runtime for each new authority file. (format: "hrid_authority_local_file_{prefix}_seq")
Table with counter Approach
New table should be created:
Code Block |
---|
theme | DJango |
---|
borderStyle | dashed |
---|
title | hrid_authority_source_file |
---|
collapse | true |
---|
|
CREATE TABLE IF NOT EXISTS hrid_authority_source_file |
...
...
authorityFileId UUID NOT NULL, |
...
...
CONSTRAINT hrid_authority_source_file_pkey PRIMARY KEY (authorityFileId), |
...
CONSTRAINT hrid_authority_source_file_fkey FOREIGN KEY (authorityFileId) |
...
REFERENCES authority_source_file (id) |
...
To work with table it's better to use SERIALIZABLE Isolation:
@Transactional(isolation = Isolation.SERIALIZABLE)
Select local authority file on the UI
...