OHDSI / OHDSI/WebAPI

Two sequences for sec_permission table

Open
#2,352 3 comments 0 reactions 1 assignee View on GitHub

@chrisknoll is already working on this.

Since Feb 20, 2024.

Dominant language
Java
Stars
151
Forks
183
Avg merge
14m
Merged PRs (30d)
2

Description

I noticed something strange in the DB definitions:

In here there is a table definition (I am using Postgres):

CREATE SEQUENCE ${ohdsiSchema}.SEC_PERMISSION_SEQUENCE START WITH 1000 INCREMENT BY 1 MAXVALUE 9223372036854775807 NO CYCLE;
CREATE TABLE ${ohdsiSchema}.SEC_PERMISSION(
    ID                  INTEGER NOT NULL DEFAULT NEXTVAL('${ohdsiSchema}.SEC_PERMISSION_SEQUENCE'),
    VALUE               VARCHAR(255) NOT NULL,
    DESCRIPTION		VARCHAR(255) NULL
);

But, around the code I see a lot of INSERT statements for other sequence for this table from here, e.g.:

INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
  (nextval('${ohdsiSchema}.sec_permission_id_seq'), 'cohortdefinition:printfriendly:cohort:post', 'Get print-friendly HTML of cohort expression');

Is there any reason there are two sequences for the same thing?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.