Add AssetOrders is_closed fix-up to DB updates + minor

This commit is contained in:
catbref 2019-03-05 11:12:00 +00:00
parent 4d69242cdb
commit bf3f78e718
3 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,6 @@ import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import io.swagger.v3.oas.annotations.media.Schema;

View File

@ -86,7 +86,7 @@ public class HSQLDBAssetRepository implements AssetRepository {
@Override
public List<AssetData> getAllAssets(Integer limit, Integer offset, Boolean reverse) throws DataException {
String sql = "SELECT owner, asset_id, description, quantity, is_divisible, reference, asset_name FROM Assets ORDER BY asset_name";
String sql = "SELECT owner, asset_id, description, quantity, is_divisible, reference, asset_name FROM Assets ORDER BY asset_id";
if (reverse != null && reverse)
sql += " DESC";
sql += HSQLDBRepository.limitOffsetSql(limit, offset);

View File

@ -588,6 +588,8 @@ public class HSQLDBDatabaseUpdates {
case 37:
// Performance-improving INDEX
stmt.execute("CREATE INDEX IF NOT EXISTS BlockGenerationHeightIndex ON Blocks (generation, height)");
// Asset orders now have isClosed=true when isFulfilled=true
stmt.execute("UPDATE AssetOrders SET is_closed = TRUE WHERE is_fulfilled = TRUE");
break;
default: