Skip to content

Commit

Permalink
Fixes #339.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbullock committed Jan 30, 2017
1 parent c4e7b98 commit 7d100ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/jbake/app/ContentStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private void createDocType(final OSchema schema, final String doctype) {

OClass page = schema.createClass(doctype);
page.createProperty(String.valueOf(DocumentAttributes.SHA1), OType.STRING).setNotNull(true);
page.createIndex(doctype + "sha1Index", OClass.INDEX_TYPE.UNIQUE, DocumentAttributes.SHA1.toString());
page.createIndex(doctype + "sha1Index", OClass.INDEX_TYPE.NOTUNIQUE, DocumentAttributes.SHA1.toString());

This comment has been minimized.

Copy link
@ancho

ancho Jan 30, 2017

Member

Hmmm...I wonder if it shouldn't stay unique. A sha1 which isn't unique does not make much sense.
Better extend the condition here to check if the uri is different.

This comment has been minimized.

Copy link
@ancho

ancho Jan 30, 2017

Member

Just forget it....I'm tired.....

This comment has been minimized.

Copy link
@jonbullock

jonbullock Jan 31, 2017

Author Member

Happy to revisit this if need be... the SHA1 hash should just be to detect a change to the file...?

This comment has been minimized.

Copy link
@ancho

ancho Feb 1, 2017

Member

Nevermind. I was tired that day and missed the context. It's all fine. But we need more tests for the different scenarios of duplicated content.

page.createProperty(String.valueOf(DocumentAttributes.SOURCE_URI), OType.STRING).setNotNull(true);
page.createIndex(doctype + "sourceUriIndex", OClass.INDEX_TYPE.UNIQUE, DocumentAttributes.SOURCE_URI.toString());
page.createProperty(String.valueOf(DocumentAttributes.CACHED), OType.BOOLEAN).setNotNull(true);
Expand Down

0 comments on commit 7d100ba

Please sign in to comment.