-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MODFQMMGR-497 Update instance date fields
Inventory storage is removing the old publication period start/end date fields and replacing it with a more general 'dates' object. This commit removes the old publication_period_start/end fields from simple_instance and replaces them with a new simple entity type (simple_instance_date_type), which is joined with simple_instance in composite_instances. The old fields are being replaced in the DB, so we don't need to bother keeping the old field definitions around
- Loading branch information
1 parent
adae3d0
commit ada53c2
Showing
6 changed files
with
114 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,4 +189,15 @@ | |
</createView> | ||
</changeSet> | ||
|
||
<changeSet id="create_view_instance_date_type" runOnChange="true" author="[email protected]"> | ||
<preConditions onFail="CONTINUE"> | ||
<tableExists tableName="instance_date_type" schemaName="${tenant_id}_mod_inventory_storage" /> | ||
</preConditions> | ||
<createView | ||
replaceIfExists="true" | ||
viewName="src_inventory_instance_date_type"> | ||
SELECT * FROM ${tenant_id}_mod_inventory_storage.instance_date_type | ||
</createView> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/resources/entity-types/simple_instance_date_type.json5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
id: '2d4bd468-720e-42b2-af41-8f4a9d7cb335', | ||
name: 'simple_instance_date_type', | ||
sources: [ | ||
{ | ||
alias: 'date_type', | ||
type: 'db', | ||
target: 'src_inventory_instance_date_type', | ||
}, | ||
], | ||
requiredPermissions: [ | ||
'inventory-storage.instance-date-types.collection.get', | ||
], | ||
columns: [ | ||
{ | ||
name: 'id', | ||
dataType: { | ||
dataType: 'rangedUUIDType', | ||
}, | ||
isIdColumn: true, | ||
queryable: true, | ||
hidden: true, | ||
essential: true, | ||
valueGetter: ':date_type.id', | ||
}, | ||
{ | ||
name: 'name', | ||
dataType: { | ||
dataType: 'stringType', | ||
}, | ||
idColumnName: 'id', | ||
queryable: true, | ||
essential: true, | ||
valueGetter: ":date_type.jsonb ->> 'name'", | ||
source: { | ||
entityTypeId: '2d4bd468-720e-42b2-af41-8f4a9d7cb335', | ||
columnName: 'name', | ||
}, | ||
valueSourceApi: { | ||
path: 'instance-date-types', | ||
valueJsonPath: '$.instanceDateTypes.*.id', | ||
labelJsonPath: '$.instanceDateTypes.*.name', | ||
}, | ||
}, | ||
{ | ||
name: 'code', | ||
dataType: { | ||
dataType: 'stringType', | ||
}, | ||
idColumnName: 'id', | ||
queryable: true, | ||
valueGetter: ":date_type.jsonb ->> 'code'", | ||
source: { | ||
entityTypeId: '2d4bd468-720e-42b2-af41-8f4a9d7cb335', | ||
columnName: 'code', | ||
}, | ||
valueSourceApi: { | ||
valueJsonPath: '$.instanceDateTypes.*.id', | ||
labelJsonPath: '$.instanceDateTypes.*.code', | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters