Skip to content

Two sequences for sec_permission table #2352

@m0nhawk

Description

@m0nhawk

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions