Skip to content

Commit

Permalink
A combined migration script has been assembled
Browse files Browse the repository at this point in the history
Reverting back entity names in @entity according to the codebase policy
  • Loading branch information
alex-odysseus committed Nov 6, 2024
1 parent 6a88e5d commit deed559
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/ohdsi/webapi/conceptset/ConceptSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*
* @author fdefalco
*/
@Entity
@Entity(name="ConceptSet")
@Table(name="concept_set")
public class ConceptSet extends CommonEntityExt<Integer> implements Serializable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @author Anthony Sena <https://github.com/ohdsi>
*/

@Entity
@Entity(name = "ConceptSetGenerationInfo")
@Table(name = "concept_set_generation_info")
@IdClass(ConceptSetGenerationInfoKey.class)
public class ConceptSetGenerationInfo implements Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @author fdefalco
*/

@Entity
@Entity(name = "ConceptSetItem")
@Table(name="concept_set_item")
public class ConceptSetItem implements Serializable{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Entity(name = "ConceptSetAnnotation")
@Table(name = "concept_set_annotation")
public class ConceptSetAnnotation extends CommonEntity<Integer> implements Serializable {
/**
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ CREATE TABLE ${ohdsiSchema}.concept_set_annotation
created_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT (now()),
modified_by_id INTEGER,
modified_date TIMESTAMP WITH TIME ZONE,
concept_set_version VARCHAR(100),
copied_from_concept_set_ids VARCHAR(1000),
CONSTRAINT pk_concept_set_annotation_id PRIMARY KEY (concept_set_annotation_id),
CONSTRAINT fk_concept_set FOREIGN KEY (concept_set_id)
REFERENCES ${ohdsiSchema}.concept_set (concept_set_id)
Expand All @@ -20,20 +22,24 @@ CREATE TABLE ${ohdsiSchema}.concept_set_annotation
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
(nextval('${ohdsiSchema}.sec_permission_id_seq'), 'conceptset:*:annotation:put', 'Create Concept Set Annotation');
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
(nextval('${ohdsiSchema}.sec_permission_id_seq'), 'conceptset:annotation:%s:delete', 'Delete Concept Set Annotation');
(nextval('${ohdsiSchema}.sec_permission_id_seq'), 'conceptset:annotation:*:delete', 'Delete Concept Set Annotation');
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
(nextval('${ohdsiSchema}.sec_permission_id_seq'), 'conceptset:%s:annotation:get', 'List Concept Set Annotation');
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
(nextval('${ohdsiSchema}.sec_permission_id_seq'), 'conceptset:*:annotation:get', 'View Concept Set Annotation');
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description) VALUES
(nextval('${ohdsiSchema}.sec_permission_id_seq'), 'conceptset:copy-annotations', 'Copy Concept Set Annotations');


INSERT INTO ${ohdsiSchema}.sec_role_permission(id, role_id, permission_id)
SELECT nextval('${ohdsiSchema}.sec_role_permission_sequence'), sr.id, sp.id
FROM ${ohdsiSchema}.sec_permission SP, ${ohdsiSchema}.sec_role sr
WHERE sp.value IN (
'conceptset:*:annotation:put',
'conceptset:annotation:%s:delete',
'conceptset:annotation:*:delete',
'conceptset:%s:annotation:get',
'conceptset:*:annotation:get'
'conceptset:*:annotation:get',
'conceptset:copy-annotations'
) AND sr.name IN ('admin');

INSERT INTO ${ohdsiSchema}.sec_role_permission(id, role_id, permission_id)
Expand All @@ -42,5 +48,6 @@ FROM ${ohdsiSchema}.sec_permission SP, ${ohdsiSchema}.sec_role sr
WHERE sp.value IN (
'conceptset:*:annotation:put',
'conceptset:%s:annotation:get',
'conceptset:*:annotation:get'
'conceptset:*:annotation:get',
'conceptset:copy-annotations'
) AND sr.name IN ('Atlas users');

0 comments on commit deed559

Please sign in to comment.