Skip to content

Commit

Permalink
DDL small changes
Browse files Browse the repository at this point in the history
- remove approval_status from licence table
- add unique idx to cost table  - entity ref, kind and year
- increase size of inclusion_predicate col on survey_instance table
  • Loading branch information
jessica-woodland-scott-db committed Dec 7, 2023
1 parent 9076aec commit 450a57d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import org.finos.waltz.common.DateTimeUtilities;
import org.finos.waltz.data.licence.LicenceDao;
import org.finos.waltz.model.ApprovalStatus;
import org.finos.waltz.model.EntityKind;
import org.finos.waltz.schema.tables.records.BookmarkRecord;
import org.finos.waltz.schema.tables.records.LicenceRecord;
Expand Down Expand Up @@ -101,7 +100,6 @@ private void importData(String path) throws IOException, URISyntaxException {
record.setName(l.name());
record.setExternalId(l.licenseId());
record.setProvenance(PROVENANCE);
record.setApprovalStatus(ApprovalStatus.PENDING_APPROVAL.name());
record.setCreatedAt(now);
record.setCreatedBy("admin");
record.setLastUpdatedAt(now);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ const initialState = {
environmentDescription: "",
licenseGridCols: [
mkLinkGridCell("Name", "name", "id", "main.licence.view"),
{field: "externalId", displayName: "External Id"},
{field: "approvalStatus", displayName: "Approval Status", cellFilter: "toDisplayName:'ApprovalStatus'"},
{field: "externalId", displayName: "External Id"}
],
visibility: {
servers: false,
Expand Down
23 changes: 23 additions & 0 deletions waltz-schema/src/main/resources/liquibase/db.changelog-1.57.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,27 @@
<tagDatabase tag="v1.56"/> <!-- tag the current db version, i.e. the last -->
</changeSet>

<changeSet id="20231207-6033-1"
author="woodjes">
<comment>6033: increase survey predicate column size</comment>
<modifyDataType columnName="inclusion_predicate"
newDataType="${long-expression.type}"
tableName="survey_question" />
</changeSet>

<changeSet id="20231207-5254-1"
author="woodjes">
<comment>5254: add unique constraint to cost on entity, type and year</comment>
<addUniqueConstraint columnNames="cost_kind_id, entity_kind, entity_id, year"
constraintName="idx_cost_entity_year_kind_unique"
tableName="cost"/>
</changeSet>

<changeSet id="20231207-6825-1"
author="woodjes">
<comment>6825: remove approval_status field from licence</comment>
<dropColumn tableName="licence"
columnName="approval_status" />
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
<property name="email.type" value="VARCHAR(255)"></property>
<property name="enum.type" value="VARCHAR(64)"></property>
<property name="expression.type" value="VARCHAR(500)"></property>
<property name="long-expression.type" value="${longvarchar.type}"></property>
<property name="external-id.type" value="VARCHAR(200)"></property>
<property name="group.type" value="VARCHAR(128)"></property>
<property name="guid.type" value="VARCHAR(64)"></property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.finos.waltz.web.WebUtilities;
import org.jooq.DSLContext;
import org.jooq.Record1;
import org.jooq.Record7;
import org.jooq.Record8;
import org.jooq.Select;
import org.jooq.SelectConditionStep;
Expand Down Expand Up @@ -61,13 +62,12 @@ public void register() {
IdSelectionOptions selectionOptions = mkOpts(entityRef);
Select<Record1<Long>> appIdSelector = applicationIdSelectorFactory.apply(selectionOptions);

SelectConditionStep<Record8<Long, String, String, String, String, Timestamp, String, String>> qry = dsl
SelectConditionStep<Record7<Long, String, String, String, Timestamp, String, String>> qry = dsl
.selectDistinct(
LICENCE.ID.as("Licence Id"),
LICENCE.NAME.as("Licence Name"),
LICENCE.DESCRIPTION.as("Description"),
LICENCE.EXTERNAL_ID.as("External Id"),
LICENCE.APPROVAL_STATUS.as("Approval Status"),
LICENCE.LAST_UPDATED_AT.as("Last Updated At"),
LICENCE.LAST_UPDATED_BY.as("Last Updated By"),
LICENCE.PROVENANCE.as("Provenance"))
Expand Down

0 comments on commit 450a57d

Please sign in to comment.