Skip to content

Commit

Permalink
[Issue #260] Rename ReadingList.created -> .lastUpdated
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpierce committed Jun 21, 2020
1 parent d5ed175 commit 84feedf
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 7 deletions.
Expand Up @@ -273,7 +273,7 @@ public class Comic {
private String summary;

@Formula(
"(SELECT COUNT(*) FROM comics c WHERE c.series = series AND c.volume = volume AND C.issue_number = issue_number)")
"(SELECT COUNT(*) FROM comics c WHERE c.series = series AND c.volume = volume AND c.issue_number = issueNumber)")
@JsonProperty("duplicateCount")
@JsonView(View.ComicList.class)
private Integer duplicateCount;
Expand Down
Expand Up @@ -66,11 +66,11 @@ public class ReadingList {
@JsonView(View.ComicList.class)
private ComiXedUser owner;

@Column(name = "created")
@JsonProperty("createdDate")
@Column(name = "last_updated")
@JsonProperty("lastUpdated")
@JsonView(View.ComicList.class)
@JsonFormat(shape = JsonFormat.Shape.NUMBER)
private Date created = new Date();
private Date lastUpdated = new Date();

public Long getId() {
return this.id;
Expand Down Expand Up @@ -103,4 +103,12 @@ public String getSummary() {
public void setSummary(String summary) {
this.summary = summary;
}

public Date getLastUpdated() {
return lastUpdated;
}

public void setLastUpdated(Date lastUpdated) {
this.lastUpdated = lastUpdated;
}
}
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>

<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">

<changeSet id="003_issue-260_rename_reading_list_created_column.xml"
author="mcpierce">

<renameColumn tableName="reading_lists"
oldColumnName="created"
newColumnName="last_updated"
columnDataType="datetime"/>

</changeSet>
</databaseChangeLog>
Expand Up @@ -8,5 +8,6 @@

<include file="/db/migrations/0.6.0/001_issue-143_add_persisted_task_tables.xml"/>
<include file="/db/migrations/0.6.0/002_issue-120_add_publisher_details_fields.xml"/>
<include file="/db/migrations/0.6.0/003_issue-260_rename_reading_list_created_column.xml"/>

</databaseChangeLog>
4 changes: 2 additions & 2 deletions comixed-library/src/test/resources/test-comics.xml
Expand Up @@ -412,12 +412,12 @@
name="First Reading List"
owner_id="1000"
summary="This is my reading list"
created="2019-01-01 13:00:00"/>
last_updated="2019-01-01 13:00:00"/>
<reading_lists id="1001"
name="Second Reading List"
owner_id="1000"
summary="This is my other reading list"
created="2019-02-01 13:00:00"/>
last_updated="2019-02-01 13:00:00"/>
<reading_list_entries id="1000"
reading_list_id="1000"
comic_id="1000"
Expand Down
Expand Up @@ -214,7 +214,7 @@ public void testConsolidate() {
List<Comic> response =
libraryController.consolidateLibrary(
new ConsolidateLibraryRequest(TEST_DELETE_PHYSICAL_FILES));

k
assertNotNull(response);
assertSame(comicList, response);

Expand Down

0 comments on commit 84feedf

Please sign in to comment.