Skip to content

Commit

Permalink
Merge pull request #7 from Canadensys/liger_issue6
Browse files Browse the repository at this point in the history
Fixed issue #6
  • Loading branch information
cgendreau committed Sep 11, 2014
2 parents 0039a49 + d43f467 commit cd93b0f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
4 changes: 3 additions & 1 deletion script/migrations/occurrence/2.10.0_to_2.11.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ ALTER TABLE occurrence_extension ADD COLUMN sourcefileid character varying(50);
ALTER TABLE occurrence_extension ADD COLUMN resource_uuid character varying(50);

--This table should be empty but if not please, transfer the content of 'id' into 'auto_id' and then delete the 'id' column
ALTER TABLE occurrence_extension DROP COLUMN IF EXISTS id;
ALTER TABLE occurrence_extension DROP COLUMN IF EXISTS id;

ALTER TABLE resource_management RENAME key TO resource_uuid;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ResourceModel {
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "resource_management_id_seq")
private Integer id;
private String name;
private String key;
private String resource_uuid;
private String archive_url;
private String sourcefileid;

Expand All @@ -31,18 +31,20 @@ public void setId(Integer id) {
this.id = id;
}

public String getResource_uuid() {
return resource_uuid;
}
public void setResource_uuid(String resource_uuid) {
this.resource_uuid = resource_uuid;
}

public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}

public String getArchive_url() {
return archive_url;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ CREATE TABLE IF NOT EXISTS resource_management
id integer DEFAULT nextval('resource_management_id_seq') NOT NULL,
sourcefileid character varying(50),
name character varying(255),
key character varying(36),
resource_uuid character varying(36),
archive_url character varying(255),
CONSTRAINT resource_management_pkey PRIMARY KEY ( id ),
CONSTRAINT resource_management_source_file_id_key UNIQUE (sourcefileid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void testSaveAndLoad(){
ResourceModel testModel = new ResourceModel();

testModel.setSourcefileid("test_sourcefileid");
testModel.setKey("12345");
testModel.setResource_uuid("12345");
assertTrue(resourceDAO.save(testModel));

int id = testModel.getId();
Expand Down

0 comments on commit cd93b0f

Please sign in to comment.