diff --git a/mauro-api/src/main/groovy/org/maurodata/controller/authority/AuthorityController.groovy b/mauro-api/src/main/groovy/org/maurodata/controller/authority/AuthorityController.groovy index 53523c994..a3adce257 100644 --- a/mauro-api/src/main/groovy/org/maurodata/controller/authority/AuthorityController.groovy +++ b/mauro-api/src/main/groovy/org/maurodata/controller/authority/AuthorityController.groovy @@ -60,6 +60,7 @@ class AuthorityController extends ItemController implements Authority accessControlService.checkAdministrator() Authority cleanedItem = cleanBody(authority) cleanedItem = updateCreationProperties(cleanedItem) as Authority + setStableId(cleanedItem) authorityService.create(cleanedItem) } diff --git a/mauro-api/src/main/groovy/org/maurodata/controller/config/ApiPropertyController.groovy b/mauro-api/src/main/groovy/org/maurodata/controller/config/ApiPropertyController.groovy index 3a01a28d8..ae73d2f0d 100644 --- a/mauro-api/src/main/groovy/org/maurodata/controller/config/ApiPropertyController.groovy +++ b/mauro-api/src/main/groovy/org/maurodata/controller/config/ApiPropertyController.groovy @@ -73,6 +73,8 @@ class ApiPropertyController extends ItemController implements ApiPr updateCreationProperties(apiProperty) + setStableId(apiProperty) + apiPropertyRepository.save(apiProperty) } diff --git a/mauro-api/src/main/groovy/org/maurodata/controller/facet/FacetController.groovy b/mauro-api/src/main/groovy/org/maurodata/controller/facet/FacetController.groovy index 5aa8051ae..7fa159ac3 100644 --- a/mauro-api/src/main/groovy/org/maurodata/controller/facet/FacetController.groovy +++ b/mauro-api/src/main/groovy/org/maurodata/controller/facet/FacetController.groovy @@ -40,8 +40,9 @@ abstract class FacetController extends ItemController implem AdministeredItem administeredItem = readAdministeredItem(domainType, domainId) accessControlService.checkRole(Role.EDITOR, administeredItem) - - createEntity(administeredItem, facet) + I created= createEntity(administeredItem, facet) + setStableId(created) + return created } protected I createEntity(@NonNull AdministeredItem administeredItem, @NonNull I cleanFacet) { diff --git a/mauro-api/src/main/groovy/org/maurodata/controller/facet/RuleRepresentationController.groovy b/mauro-api/src/main/groovy/org/maurodata/controller/facet/RuleRepresentationController.groovy index 48f7262fc..92356f350 100644 --- a/mauro-api/src/main/groovy/org/maurodata/controller/facet/RuleRepresentationController.groovy +++ b/mauro-api/src/main/groovy/org/maurodata/controller/facet/RuleRepresentationController.groovy @@ -70,6 +70,7 @@ class RuleRepresentationController extends ItemController im accessControlService.checkRole(Role.EDITOR, readAdministeredItemForFacet(rule)) ruleRepresentation.ruleId = rule.id updateCreationProperties(ruleRepresentation) + setStableId(ruleRepresentation) ruleRepresentationCacheableRepository.save(ruleRepresentation) } diff --git a/mauro-api/src/main/groovy/org/maurodata/controller/facet/SummaryMetadataReportController.groovy b/mauro-api/src/main/groovy/org/maurodata/controller/facet/SummaryMetadataReportController.groovy index f39f85c39..96db1f2ea 100644 --- a/mauro-api/src/main/groovy/org/maurodata/controller/facet/SummaryMetadataReportController.groovy +++ b/mauro-api/src/main/groovy/org/maurodata/controller/facet/SummaryMetadataReportController.groovy @@ -63,6 +63,7 @@ class SummaryMetadataReportController extends ItemController implements FolderApi { folder.authority = super.authorityService.getDefaultAuthority() pathRepository.readParentItems(folder) folder.updatePath() + setStableId(folder) folderRepository.save(folder) } diff --git a/mauro-api/src/main/groovy/org/maurodata/controller/folder/VersionedFolderController.groovy b/mauro-api/src/main/groovy/org/maurodata/controller/folder/VersionedFolderController.groovy index 5b0e5fe42..04ed3b0cb 100644 --- a/mauro-api/src/main/groovy/org/maurodata/controller/folder/VersionedFolderController.groovy +++ b/mauro-api/src/main/groovy/org/maurodata/controller/folder/VersionedFolderController.groovy @@ -85,7 +85,7 @@ class VersionedFolderController extends ModelController implements Versi pathRepository.readParentItems(folder) folder.updatePath() - + setStableId(folder) folderRepository.save(folder) } diff --git a/mauro-api/src/main/groovy/org/maurodata/controller/model/AdministeredItemController.groovy b/mauro-api/src/main/groovy/org/maurodata/controller/model/AdministeredItemController.groovy index e7794f856..eb48457ef 100644 --- a/mauro-api/src/main/groovy/org/maurodata/controller/model/AdministeredItemController.groovy +++ b/mauro-api/src/main/groovy/org/maurodata/controller/model/AdministeredItemController.groovy @@ -99,6 +99,7 @@ abstract class AdministeredItemController implements AdministeredItemReader * Properties disallowed in a simple update request. */ List getDisallowedProperties() { - ['class_', 'class', 'id', 'dateCreated', 'lastUpdated', 'createdBy', 'versionable', 'domainType', 'version'] + ['class_', 'class', 'id', 'dateCreated', 'lastUpdated', 'createdBy', 'versionable', 'domainType', 'version', 'stableId'] } /** @@ -94,4 +94,10 @@ abstract class ItemController implements AdministeredItemReader } return hasChanged } + + protected void setStableId(Item item) { + if(item.stableId){return} + + item.stableId=UUID.randomUUID() + } } diff --git a/mauro-api/src/main/groovy/org/maurodata/controller/security/ApiKeyController.groovy b/mauro-api/src/main/groovy/org/maurodata/controller/security/ApiKeyController.groovy index 99802ae4c..7e782ac8d 100644 --- a/mauro-api/src/main/groovy/org/maurodata/controller/security/ApiKeyController.groovy +++ b/mauro-api/src/main/groovy/org/maurodata/controller/security/ApiKeyController.groovy @@ -54,6 +54,7 @@ class ApiKeyController extends ItemController implements ApiKeyApi { apiKey.disabled = false } apiKey.updateExpiryDate() + setStableId(apiKey) apiKeyCacheableRepository.save(apiKey) } diff --git a/mauro-api/src/main/groovy/org/maurodata/controller/security/CatalogueUserController.groovy b/mauro-api/src/main/groovy/org/maurodata/controller/security/CatalogueUserController.groovy index 5eef4ae9e..48b766252 100644 --- a/mauro-api/src/main/groovy/org/maurodata/controller/security/CatalogueUserController.groovy +++ b/mauro-api/src/main/groovy/org/maurodata/controller/security/CatalogueUserController.groovy @@ -60,6 +60,7 @@ class CatalogueUserController extends ItemController implements C newUser.salt = SecureRandomStringGenerator.generateSalt() newUser.password = null + setStableId(newUser) catalogueUserRepository.save(newUser) } diff --git a/mauro-api/src/main/groovy/org/maurodata/controller/security/SecurableResourceGroupRoleController.groovy b/mauro-api/src/main/groovy/org/maurodata/controller/security/SecurableResourceGroupRoleController.groovy index 831d468fe..a65810d09 100644 --- a/mauro-api/src/main/groovy/org/maurodata/controller/security/SecurableResourceGroupRoleController.groovy +++ b/mauro-api/src/main/groovy/org/maurodata/controller/security/SecurableResourceGroupRoleController.groovy @@ -59,6 +59,7 @@ class SecurableResourceGroupRoleController extends ItemController implements UserGroup @Post(Paths.USER_GROUP_LIST) UserGroup create(@Body @NonNull UserGroup userGroup) { accessControlService.checkAdministrator() + setStableId(userGroup) userGroupRepository.save(userGroup) } } diff --git a/mauro-api/src/test/groovy/org/maurodata/datamodel/DataModelNewBranchVersionIntegrationSpec.groovy b/mauro-api/src/test/groovy/org/maurodata/datamodel/DataModelNewBranchVersionIntegrationSpec.groovy index 372638bcd..28b2cb36a 100644 --- a/mauro-api/src/test/groovy/org/maurodata/datamodel/DataModelNewBranchVersionIntegrationSpec.groovy +++ b/mauro-api/src/test/groovy/org/maurodata/datamodel/DataModelNewBranchVersionIntegrationSpec.groovy @@ -28,6 +28,8 @@ class DataModelNewBranchVersionIntegrationSpec extends CommonDataSpec { @Shared UUID dataModelId @Shared + UUID dataModelStableId + @Shared UUID dataTypeId1 @Shared UUID dataTypeId2 @@ -63,6 +65,7 @@ class DataModelNewBranchVersionIntegrationSpec extends CommonDataSpec { folderId = folderApi.create(folder()).id dataModel = dataModelApi.create(folderId, dataModelPayload()) dataModelId = dataModel.id + dataModelStableId = dataModel.stableId dataTypeId1 = dataTypeApi.create(dataModelId, new DataType(label: 'string', description: 'character string of variable length', @@ -138,6 +141,8 @@ class DataModelNewBranchVersionIntegrationSpec extends CommonDataSpec { newBranchVersionDataModel.summaryMetadata[0].id != summaryMetadataId newBranchVersionDataModel.summaryMetadata[0].summaryMetadataReports.size() == 1 newBranchVersionDataModel.summaryMetadata[0].summaryMetadataReports[0].id != summaryMetadataReportId + //stable id carries over + newBranchVersionDataModel.stableId==dataModelStableId when: ListResponse dataModelsList = dataModelApi.list(folderId) diff --git a/mauro-api/src/test/groovy/org/maurodata/folder/FolderIntegrationSpec.groovy b/mauro-api/src/test/groovy/org/maurodata/folder/FolderIntegrationSpec.groovy index d8963ed8a..42f414f99 100644 --- a/mauro-api/src/test/groovy/org/maurodata/folder/FolderIntegrationSpec.groovy +++ b/mauro-api/src/test/groovy/org/maurodata/folder/FolderIntegrationSpec.groovy @@ -33,6 +33,7 @@ class FolderIntegrationSpec extends CommonDataSpec { folderResponse.label == 'Test folder' folderResponse.path.toString() == 'fo:Test folder' folderResponse.authority + folderResponse.stableId } void 'create child folder'() { diff --git a/mauro-domain/src/main/groovy/org/maurodata/domain/model/Item.groovy b/mauro-domain/src/main/groovy/org/maurodata/domain/model/Item.groovy index 9b8d4bf75..f91b35009 100644 --- a/mauro-domain/src/main/groovy/org/maurodata/domain/model/Item.groovy +++ b/mauro-domain/src/main/groovy/org/maurodata/domain/model/Item.groovy @@ -80,4 +80,11 @@ abstract class Item implements Serializable { dateCreated = null lastUpdated = null } + + /** + * The unchanging immutable identity of an object. This value persists between versions. + * Set when the object is created for the first time + */ + @Nullable + UUID stableId } diff --git a/mauro-persistence/src/main/resources/db/migration/core/V0__initialise_schema.sql b/mauro-persistence/src/main/resources/db/migration/core/V0__initialise_schema.sql index 0edddbb32..1366839d1 100644 --- a/mauro-persistence/src/main/resources/db/migration/core/V0__initialise_schema.sql +++ b/mauro-persistence/src/main/resources/db/migration/core/V0__initialise_schema.sql @@ -15,7 +15,8 @@ create table core."authority" "created_by" uuid, "breadcrumb_tree_id" uuid, "url" varchar(255) not null, - "default_authority" boolean default false + "default_authority" boolean default false, + "stable_id" uuid ); -- Metadata @@ -30,7 +31,8 @@ create table "core"."metadata" "created_by" uuid, "namespace" text not null, "key" text not null, - "value" text not null + "value" text not null, + "stable_id" uuid ); create unique index "idx_metadata_multi_facet_aware_item_id_namespace_key" on "core"."metadata" (multi_facet_aware_item_id, namespace, key); @@ -46,7 +48,8 @@ create table "core"."version_link" "created_by" uuid, "version_link_type" varchar(255) not null, "target_model_id" uuid not null, - "target_model_domain_type" varchar(255) not null + "target_model_domain_type" varchar(255) not null, + "stable_id" uuid ); create unique index "idx_version_link_multi_facet_aware_item_id_target_model_id" on "core"."version_link" (multi_facet_aware_item_id, target_model_id); @@ -73,7 +76,8 @@ create table core."folder" "model_version" varchar(255), "model_version_tag" varchar(255), "parent_folder_id" uuid, - "class" varchar(255) + "class" varchar(255), + "stable_id" uuid ); create index "idx_folder_parent_folder_id" on core."folder" (parent_folder_id); @@ -100,7 +104,8 @@ create table security."catalogue_user" "last_login" timestamp with time zone, "salt" bytea not null, "password" bytea, - "temp_password" varchar(255) + "temp_password" varchar(255), + "stable_id" uuid ); create unique index "idx_catalogue_user_email_address" on "security"."catalogue_user" (trim(lower(email_address))); @@ -114,7 +119,8 @@ create table security."user_group" "name" varchar(255) not null, "description" text, "undeletable" boolean default false, - "application_role" varchar(255) + "application_role" varchar(255), + "stable_id" uuid ); create unique index "idx_security_user_group_name" on security.user_group (trim(lower(name))); @@ -128,7 +134,8 @@ create table security."securable_resource_group_role" "securable_resource_domain_type" varchar(255) not null, "securable_resource_id" uuid not null, "user_group_id" uuid not null references security.user_group (id) initially deferred, - "role" varchar(255) not null + "role" varchar(255) not null, + "stable_id" uuid ); create unique index "idx_securable_resource_group_role_securable_resource_user_group_id" on security.securable_resource_group_role (securable_resource_domain_type, securable_resource_id, user_group_id); @@ -166,7 +173,8 @@ create table terminology."terminology" "authority_id" uuid /*NOT NULL REFERENCES authority(id) initially deferred*/, "branch_name" varchar(255), "model_version" varchar(255), - "model_version_tag" varchar(255) + "model_version_tag" varchar(255), + "stable_id" uuid ); create unique index "idx_terminology_folder_id_label_branch_name_model_version" on terminology."terminology" (folder_id, label, branch_name, model_version); @@ -184,7 +192,8 @@ create table terminology."term_relationship_type" "idx" integer, "terminology_id" uuid not null references terminology.terminology (id) initially deferred, "parental_relationship" boolean, - "child_relationship" boolean + "child_relationship" boolean, + "stable_id" uuid ); create unique index "idx_term_relationship_type_terminology_id_label" on terminology."term_relationship_type" (terminology_id, label); @@ -206,7 +215,8 @@ create table terminology."term" "definition" text not null, "url" varchar(255), "is_parent" boolean, - "depth" integer + "depth" integer, + "stable_id" uuid ); create unique index "idx_term_terminology_id_code" on terminology."term" (terminology_id, code); @@ -225,7 +235,8 @@ create table terminology."term_relationship" "terminology_id" uuid not null references terminology.terminology (id) initially deferred, "source_term_id" uuid not null references terminology.term (id) initially deferred, "target_term_id" uuid not null references terminology.term (id) initially deferred, - "relationship_type_id" uuid not null references terminology.term_relationship_type (id) initially deferred + "relationship_type_id" uuid not null references terminology.term_relationship_type (id) initially deferred, + "stable_id" uuid ); create index "idx_term_relationship_terminology_id" on terminology."term_relationship" (terminology_id); @@ -258,7 +269,8 @@ create table datamodel."data_model" ( "authority_id" uuid /*NOT NULL REFERENCES authority(id) initially deferred*/, "branch_name" varchar(255), "model_version" varchar(255), - "model_version_tag" varchar(255) + "model_version_tag" varchar(255), + "stable_id" uuid ); @@ -280,7 +292,8 @@ create table datamodel."data_class" ( "description" text, "aliases_string" text, "min_multiplicity" integer, - "max_multiplicity" integer + "max_multiplicity" integer, + "stable_id" uuid ); create index "idx_data_class_data_model_id" on datamodel."data_class"(data_model_id); @@ -302,7 +315,8 @@ create table datamodel."data_type" ( "units" varchar(255), "reference_class_id" uuid references datamodel.data_class(id) initially deferred, "model_resource_id" uuid, - "model_resource_domain_type" varchar(255) + "model_resource_domain_type" varchar(255), + "stable_id" uuid ); create index "idx_data_type_data_model_id" on datamodel."data_type"(data_model_id); @@ -322,7 +336,8 @@ create table datamodel."data_element" ( "description" text, "aliases_string" text, "min_multiplicity" integer, - "max_multiplicity" integer + "max_multiplicity" integer, + "stable_id" uuid ); create index "idx_data_element_data_class_id" on datamodel."data_element"(data_class_id); create index "idx_data_element_data_type_id" on datamodel."data_element"(data_type_id); @@ -342,7 +357,8 @@ create table datamodel."enumeration_value" ( "aliases_string" text, "category" text, "key" text not null, - "value" text + "value" text, + "stable_id" uuid ); create index "idx_enumeration_value_enumeration_type_id" on datamodel."enumeration_value"(enumeration_type_id); @@ -364,7 +380,8 @@ create table "core"."edit" ( "multi_facet_aware_item_id" uuid not null, "created_by" uuid not null, "description" text not null, - "title" varchar(255) not null + "title" varchar(255) not null, + "stable_id" uuid ); create table "core"."semantic_link" @@ -379,5 +396,6 @@ create table "core"."semantic_link" "link_type" varchar(255) not null, "target_multi_facet_aware_item_id" uuid not null, "target_multi_facet_aware_item_domain_type" varchar(255) not null, - "unconfirmed" boolean not null + "unconfirmed" boolean not null, + "stable_id" uuid ); diff --git a/mauro-persistence/src/main/resources/db/migration/core/V10__security_api_key.sql b/mauro-persistence/src/main/resources/db/migration/core/V10__security_api_key.sql index 532cce64b..15208cb82 100644 --- a/mauro-persistence/src/main/resources/db/migration/core/V10__security_api_key.sql +++ b/mauro-persistence/src/main/resources/db/migration/core/V10__security_api_key.sql @@ -8,7 +8,8 @@ create table security.api_key ( "disabled" boolean not null, "catalogue_user_id" uuid not null references security.catalogue_user (id) initially deferred, "name" varchar(255) not null, - "created_by" uuid + "created_by" uuid, + "stable_id" uuid ); create index apiKey_created_by_idx ON security.api_key(created_by); create index apiKey_catalogue_user_idx ON security.api_key(catalogue_user_id); diff --git a/mauro-persistence/src/main/resources/db/migration/core/V11__core_rule.sql b/mauro-persistence/src/main/resources/db/migration/core/V11__core_rule.sql index 4c5d3a182..cb4d3ce39 100644 --- a/mauro-persistence/src/main/resources/db/migration/core/V11__core_rule.sql +++ b/mauro-persistence/src/main/resources/db/migration/core/V11__core_rule.sql @@ -8,7 +8,8 @@ create table if not exists core."rule" ( "multi_facet_aware_item_id" uuid not null, "created_by" varchar(255), "name" text not null, - "description" text + "description" text, + "stable_id" uuid ); create unique index "idx_rule_multi_facet_aware_item_id_rule" on "core"."rule" (multi_facet_aware_item_id, name); @@ -20,7 +21,8 @@ create table if not exists core.rule_representation ( "created_by" varchar(255), "language" varchar(255) not null, "representation" text, - "rule_id" uuid not null references core.rule (id) initially deferred + "rule_id" uuid not null references core.rule (id) initially deferred, + "stable_id" uuid ); create index "idx_rule_representation_rule_id" on "core"."rule_representation" (rule_id); diff --git a/mauro-persistence/src/main/resources/db/migration/core/V12__federation.sql b/mauro-persistence/src/main/resources/db/migration/core/V12__federation.sql index 88cbb9355..bd9ac4ef5 100644 --- a/mauro-persistence/src/main/resources/db/migration/core/V12__federation.sql +++ b/mauro-persistence/src/main/resources/db/migration/core/V12__federation.sql @@ -19,7 +19,8 @@ create table if not exists federation."subscribed_catalogue" ( "client_id" text, "client_secret" text, "access_token" text, - "access_token_expiry_time" timestamp + "access_token_expiry_time" timestamp, + "stable_id" uuid ); create table if not exists federation."subscribed_model" ( @@ -35,7 +36,8 @@ create table if not exists federation."subscribed_model" ( "subscribed_model_type" text, "folder_id" uuid not null, "last_read" timestamp with time zone, - "local_model_id" uuid + "local_model_id" uuid, + "stable_id" uuid ); create index "idx_subscribed_model_subscribed_catalogue_id" on federation."subscribed_model" (subscribed_catalogue_id); diff --git a/mauro-persistence/src/main/resources/db/migration/core/V1__create_terminology_codeset.sql b/mauro-persistence/src/main/resources/db/migration/core/V1__create_terminology_codeset.sql index 69a21447d..837eee3e1 100644 --- a/mauro-persistence/src/main/resources/db/migration/core/V1__create_terminology_codeset.sql +++ b/mauro-persistence/src/main/resources/db/migration/core/V1__create_terminology_codeset.sql @@ -25,7 +25,8 @@ create table if not exists terminology.code_set "authority_id" uuid /*NOT NULL REFERENCES authority(id) initially deferred*/, "branch_name" varchar(255), "model_version" varchar(255), - "model_version_tag" varchar(255) + "model_version_tag" varchar(255), + "stable_id" uuid ); create unique index "idx_codeset_folder_id_label_branch_name_model_version" on terminology."code_set" (folder_id, label, branch_name, model_version); diff --git a/mauro-persistence/src/main/resources/db/migration/core/V2__core_summary_metadata.sql b/mauro-persistence/src/main/resources/db/migration/core/V2__core_summary_metadata.sql index 997a17b34..381d6c847 100644 --- a/mauro-persistence/src/main/resources/db/migration/core/V2__core_summary_metadata.sql +++ b/mauro-persistence/src/main/resources/db/migration/core/V2__core_summary_metadata.sql @@ -9,7 +9,8 @@ create table if not exists core."summary_metadata" ( "created_by" varchar(255), "summary_metadata_type" varchar(255) not null, "label" text not null, - "description" text + "description" text, + "stable_id" uuid ); create unique index "idx_summary_metadata_multi_facet_aware_item_id_summary_metadata_type" on "core"."summary_metadata" (multi_facet_aware_item_id, label, summary_metadata_type); @@ -21,7 +22,8 @@ create table if not exists core.summary_metadata_report ( "report_date" timestamp with time zone, "created_by" varchar(255), "report_value" text not null, - "summary_metadata_id" uuid not null references core.summary_metadata (id) initially deferred + "summary_metadata_id" uuid not null references core.summary_metadata (id) initially deferred, + "stable_id" uuid ); create index "idx_summary_metadata_report_summary_metadata_id" on "core"."summary_metadata_report" (summary_metadata_id); diff --git a/mauro-persistence/src/main/resources/db/migration/core/V3__core_annotation.sql b/mauro-persistence/src/main/resources/db/migration/core/V3__core_annotation.sql index dc053314e..5b6befeaa 100644 --- a/mauro-persistence/src/main/resources/db/migration/core/V3__core_annotation.sql +++ b/mauro-persistence/src/main/resources/db/migration/core/V3__core_annotation.sql @@ -9,7 +9,8 @@ create table if not exists core."annotation" ( "parent_annotation_id" uuid, "created_by" text, "label" text, - "description" text + "description" text, + "stable_id" uuid ); create index "idx_annotation_multi_facet_aware_item_id" on "core"."annotation" (multi_facet_aware_item_id); diff --git a/mauro-persistence/src/main/resources/db/migration/core/V6__core_api_property.sql b/mauro-persistence/src/main/resources/db/migration/core/V6__core_api_property.sql index 49ec64b09..cde265f40 100644 --- a/mauro-persistence/src/main/resources/db/migration/core/V6__core_api_property.sql +++ b/mauro-persistence/src/main/resources/db/migration/core/V6__core_api_property.sql @@ -10,7 +10,8 @@ create table core.api_property "value" text, "publicly_visible" boolean not null, "category" varchar(255), - "last_updated_by" uuid + "last_updated_by" uuid, + "stable_id" uuid ); create unique index "idx_api_property_key" on core.api_property (key); \ No newline at end of file diff --git a/mauro-persistence/src/main/resources/db/migration/core/V7__dataflow.sql b/mauro-persistence/src/main/resources/db/migration/core/V7__dataflow.sql index dce5b8dd4..6af70469b 100644 --- a/mauro-persistence/src/main/resources/db/migration/core/V7__dataflow.sql +++ b/mauro-persistence/src/main/resources/db/migration/core/V7__dataflow.sql @@ -11,7 +11,8 @@ create table if not exists "dataflow"."data_flow" ( "created_by" uuid, "aliases_string" text, "definition" text, - "diagram_layout" text + "diagram_layout" text, + "stable_id" uuid ); create table if not exists "dataflow"."data_class_component" ( @@ -25,7 +26,8 @@ create table if not exists "dataflow"."data_class_component" ( "description" text, "aliases_string" text, "created_by" uuid, - "definition" text + "definition" text, + "stable_id" uuid ); create index "idx_data_class_component_data_flow_id" on "dataflow"."data_class_component" (data_flow_id); @@ -41,7 +43,8 @@ create table if not exists "dataflow"."data_element_component" ( "description" text, "aliases_string" text, "created_by" uuid, - "definition" text + "definition" text, + "stable_id" uuid ); create index "idx_data_element_component_data_class_component_id" on "dataflow"."data_element_component" (data_class_component_id); diff --git a/mauro-persistence/src/main/resources/db/migration/core/V8__core_reference_file.sql b/mauro-persistence/src/main/resources/db/migration/core/V8__core_reference_file.sql index 650586b17..8b1b3fc78 100644 --- a/mauro-persistence/src/main/resources/db/migration/core/V8__core_reference_file.sql +++ b/mauro-persistence/src/main/resources/db/migration/core/V8__core_reference_file.sql @@ -10,7 +10,8 @@ create table if not exists core."reference_file" ( "file_type" varchar(255) not null, "file_name" varchar(255) not null, "file_contents" bytea not null, - "created_by" text + "created_by" text, + "stable_id" uuid ); create index "idx_reference_file_multi_facet_aware_item_id" on "core"."reference_file" (multi_facet_aware_item_id); diff --git a/mauro-persistence/src/main/resources/db/migration/core/V9__core_classifications.sql b/mauro-persistence/src/main/resources/db/migration/core/V9__core_classifications.sql index a54e66749..325b2573e 100644 --- a/mauro-persistence/src/main/resources/db/migration/core/V9__core_classifications.sql +++ b/mauro-persistence/src/main/resources/db/migration/core/V9__core_classifications.sql @@ -25,7 +25,8 @@ create table if not exists core."classification_scheme" ( "authority_id" uuid, "branch_name" varchar(255), "model_version" varchar(255), - "model_version_tag" varchar(255) + "model_version_tag" varchar(255), + "stable_id" uuid ); create table if not exists core."classifier" ( @@ -39,7 +40,8 @@ create table if not exists core."classifier" ( "aliases_string" text, "created_by" uuid, "classification_scheme_id" uuid not null references core.classification_scheme(id) initially deferred, - "parent_classifier_id" uuid null references core.classifier(id) initially deferred + "parent_classifier_id" uuid null references core.classifier(id) initially deferred, + "stable_id" uuid ); create index "idx_classifier_classification_scheme_id" on core."classifier" (classification_scheme_id);