Bug: Schema Service Cosmos DB Collections partition key is incorrectly named
Schema Service is attempting to enable Partition Aware support for the Service. See this MR
Schema Service uses the following 4 Cosmos Collections.
- Authority
- EntityType
- SchemaInfo
- Source
Currently each of these collections are configured to have the following keys.
{
name = "Authority"
database_name = "osdu-db"
partition_key_path = "/dataPartitionId"
},
{
name = "EntityType"
database_name = "osdu-db"
partition_key_path = "/dataPartitionId"
},
{
name = "SchemaInfo"
database_name = "osdu-db"
partition_key_path = "/dataPartitionId"
},
{
name = "Source"
database_name = "osdu-db"
partition_key_path = "/dataPartitionId"
}
These keys need to change to enable partition support.
{
name = "Authority"
database_name = "osdu-db"
partition_key_path = "/id"
},
{
name = "EntityType"
database_name = "osdu-db"
partition_key_path = "/id"
},
{
name = "SchemaInfo"
database_name = "osdu-db"
partition_key_path = "/partitionId"
},
{
name = "Source"
database_name = "osdu-db"
partition_key_path = "/id"
}
This change will be intrusive and will drop collection in Cosmos DB and all data in those collections if they exist.
It has been determined that since Schema service is still in development and doesn't properly work that this has no impact to real data and is okay to perform this action.