Uploaded image for project: 'Atlas'
  1. Atlas
  2. ATLAS-4181

Provide option to add mandatory attribute to existing entity definition

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.0
    • 3.0.0, 2.2.0
    • atlas-core
    • None

    Description

      Currently, Atlas allows to add only optional attributes to existing entity type and it doesn’t allow to add any mandatory attribute.

      Atlas should allow users to add mandatory attributes to existing entity types. To provide backward compatibility without breaking any contract between updated entity definition and existing entities, once entity def gets updated with mandatory attribute it should update all entities of same type and all subtypes with mandatory attribute.

      This feature should allow only if new mandatory attribute is primitive type, non-unique and has non-empty default value.

      Design diagram attached for reference.

      With this feature, mandatory attributes can be added to existing typedef using "ADD_MANDATORY_ATTRIBUTE" typedef patch action.

      Below is the sample of data to be used to patch.

      {
      "id": "<TYPEDEF_PATCH_ID>",
      "description": "<PATCH_DESCRIPTION>",
      "action": "ADD_MANDATORY_ATTRIBUTE",
      "typeName": "<ENTITY_TYPE>",
      "applyToVersion": "1.1",
      "updateToVersion": "1.2",
      "params": null,
      "attributeDefs": [

      { "name": "<MANDATORY_ATTRIBUTE_NAME>", "typeName": "<PRIMITIVE_TYPE>", "cardinality": "SINGLE", "isIndexable": false, "isOptional": false, "isUnique": false, "defaultValue": "<DEFAULT_VALUE_OF_ATTRIBUTE>" }

      ]
      }

      Attachments

        Issue Links

          Activity

            People

              radhikak Radhika Kundam
              radhikak Radhika Kundam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: