diff --git a/pom.xml b/pom.xml index a5e2bb6..2f991a1 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ ee.eesti.riha rest - 0.7.0 + 0.8.0 war diff --git a/sql/create_views.sql b/sql/create_views.sql index 7c15700..0e51d28 100644 --- a/sql/create_views.sql +++ b/sql/create_views.sql @@ -1,7 +1,8 @@ CREATE OR REPLACE VIEW riha.main_resource_view AS SELECT DISTINCT ON (json_content ->> 'uuid') *, - ((main_resource.json_content #>> '{meta,creation_timestamp}'::text[]))::timestamp AS j_creation_timestamp + ((main_resource.json_content #>> '{meta,creation_timestamp}'::text[]))::timestamp AS j_creation_timestamp, + ((main_resource.json_content #>> '{meta,update_timestamp}'::text[]))::timestamp AS j_update_timestamp FROM riha.main_resource as main_resource ORDER BY json_content ->> 'uuid', - creation_date DESC, + j_update_timestamp DESC NULLS LAST, main_resource_id DESC; \ No newline at end of file diff --git a/sql/update/update_27102017_update_main_resource_view_ordering.sql b/sql/update/update_27102017_update_main_resource_view_ordering.sql new file mode 100644 index 0000000..0e51d28 --- /dev/null +++ b/sql/update/update_27102017_update_main_resource_view_ordering.sql @@ -0,0 +1,8 @@ +CREATE OR REPLACE VIEW riha.main_resource_view AS + SELECT DISTINCT ON (json_content ->> 'uuid') *, + ((main_resource.json_content #>> '{meta,creation_timestamp}'::text[]))::timestamp AS j_creation_timestamp, + ((main_resource.json_content #>> '{meta,update_timestamp}'::text[]))::timestamp AS j_update_timestamp + FROM riha.main_resource as main_resource + ORDER BY json_content ->> 'uuid', + j_update_timestamp DESC NULLS LAST, + main_resource_id DESC; \ No newline at end of file diff --git a/src/main/java/ee/eesti/riha/rest/model/Comment.java b/src/main/java/ee/eesti/riha/rest/model/Comment.java index 29c82a8..d917e23 100644 --- a/src/main/java/ee/eesti/riha/rest/model/Comment.java +++ b/src/main/java/ee/eesti/riha/rest/model/Comment.java @@ -25,7 +25,7 @@ @TypeDefs({@TypeDef(name = "JsonObject", typeClass = JsonObjectUserType.class) }) @Transactional @Entity -@Table(name = "comment", schema = "riha") +@Table(name = "comment") @JsonInclude(Include.NON_NULL) public class Comment implements BaseModel { diff --git a/src/main/resources/riharest.project.properties b/src/main/resources/riharest.project.properties index 694b726..a2d0f05 100644 --- a/src/main/resources/riharest.project.properties +++ b/src/main/resources/riharest.project.properties @@ -1,4 +1,4 @@ -riharest.jdbc.url=jdbc:postgresql://192.168.1.37:5432/riha?currentSchema=riha +riharest.jdbc.url=jdbc:postgresql://localhost:5432/riha?currentSchema=riha riharest.jdbc.user=postgres riharest.jdbc.password=admin