Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Remove unused circular ref between HTextFlow and HPotEntryData
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Oct 27, 2014
1 parent 8321161 commit 7d0f539
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
Expand Up @@ -55,7 +55,6 @@ public class HPotEntryData implements Serializable {
private static final long serialVersionUID = 1L;

private Long id;
private HTextFlow textFlow;
private String context;
@Deprecated
// use HTextFlow.comment
Expand All @@ -73,12 +72,6 @@ protected void setId(Long id) {
this.id = id;
}

@OneToOne
@JoinColumn(name = "tf_id", /* nullable=false, */unique = true)
@NaturalId
public HTextFlow getTextFlow() {
return textFlow;
}

public String getContext() {
return context;
Expand Down
13 changes: 13 additions & 0 deletions zanata-war/src/main/resources/db/changelogs/db.changelog-3.6.xml
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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.0.xsd">

<changeSet id="1" author="sflaniga@redhat.com">
<comment>Break circular reference between HTextFlow and HPotEntryData</comment>
<dropForeignKeyConstraint baseTableName="HPotEntryData" constraintName="FK17A648CFCCAD9D19"/>
<dropColumn tableName="HPotEntryData" columnName="tf_id" />
</changeSet>

</databaseChangeLog>
2 changes: 2 additions & 0 deletions zanata-war/src/main/resources/db/db.changelog.xml
Expand Up @@ -35,6 +35,8 @@
file="changelogs/db.changelog-3.3.xml" />
<include relativeToChangelogFile="true"
file="changelogs/db.changelog-3.4.xml" />
<include relativeToChangelogFile="true"
file="changelogs/db.changelog-3.6.xml" />

<!-- NB: triggers must be created after all table changes -->
<!-- If the Liquibase version is being updated, please refer to the
Expand Down
Expand Up @@ -533,9 +533,6 @@ private void assertTextFlow(boolean checkPos, HTextFlow existingTextFlow,
assertThat(newTextFlow.getPotEntryData().getReferences())
.isEqualTo(
existingTextFlow.getPotEntryData().getReferences());

assertThat(newTextFlow.getPotEntryData().getTextFlow()).isEqualTo(
newTextFlow);
}
}

Expand Down
Expand Up @@ -86,13 +86,14 @@
project_iteration_id="3" revision="1" obsolete="0"
last_modified_by_id="1" poHeader_id="1" />

<HPotEntryData id="1" context="context" comment_id="1" />

<HTextFlow id="1" document_id="1" resId="tf1" revision="1" pos="0"
obsolete="0" plural="true" wordCount="11" comment_id="1"
contentHash="5eb63bbbe01eeed093cb22bb8f5acdc3" content0="hello world"
potEntryData_id="1"
content1="hello world1" />

<HPotEntryData id="1" context="context" comment_id="1" tf_id="1" />

<HTextFlow id="2" document_id="1" resId="tf2" revision="1" pos="1"
obsolete="0" plural="false" wordCount="11"
contentHash="5eb63bbbe01eeed093cb22bb8f5acdc3" content0="hello world2" />
Expand Down

0 comments on commit 7d0f539

Please sign in to comment.