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

Commit

Permalink
rhbz1183994 - add index on lastModifiedBy column and fail on invalid …
Browse files Browse the repository at this point in the history
…timezone
  • Loading branch information
Patrick Huang committed Mar 19, 2015
1 parent 697b4c6 commit da5ac91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Expand Up @@ -38,14 +38,12 @@ static DateRange from(String dateRangeParam, String fromTimezoneId) {
if (dateRange.length != 2) {
throw new InvalidDateParamException(dateRangeParam);
}
// here we use java util timezone first because it supports more short IDs
DateTimeZone zone;
if (fromTimezoneId == null) {
zone = DateTimeZone.getDefault();
} else {
try {
zone =
DateTimeZone.forTimeZone(TimeZone.getTimeZone(fromTimezoneId));
zone = DateTimeZone.forID(fromTimezoneId);
} catch (IllegalArgumentException e) {
throw new BadRequestException("Invalid timezone ID:" + fromTimezoneId);
}
Expand Down
10 changes: 10 additions & 0 deletions zanata-war/src/main/resources/db/changelogs/db.changelog-3.7.xml
Expand Up @@ -48,6 +48,16 @@
</createIndex>
</changeSet>

<changeSet id="3" author="pahuang@redhat.com">
<comment>add indexes to HTextFlowTargetHistory and HTextFlowTarget table</comment>
<createIndex tableName="HTextFlowTargetHistory" indexName="Idx_lastModifiedBy">
<column name="last_modified_by_id"/>
</createIndex>
<createIndex tableName="HTextFlowTarget" indexName="Idx_lastModifiedBy">
<column name="last_modified_by_id"/>
</createIndex>
</changeSet>

<changeSet id="3" author="aeng@redhat.com">
<comment>Add revisionComment to HTextFlowTarget, HTextFlowTargetHistory</comment>
<addColumn tableName="HTextFlowTarget">
Expand Down

0 comments on commit da5ac91

Please sign in to comment.