stroom icon indicating copy to clipboard operation
stroom copied to clipboard

sQL , how do we deal with duplicate vis?

Open stroomdev10 opened this issue 1 year ago • 1 comments

stroomdev10 avatar Mar 12 '24 12:03 stroomdev10

The current thinking is to introduce the concept of a uniqueName property to each doc. This is a globally unique string within a stroom instance. uniqueName would have the form <type>:<name>, e.g. dictionary:my_dict and would only allow [a-zA-Z0-9:_-]. Although both upper and lower case are allowed, the name would be treated as case insensitive so any case could be used when referencing it. The <name> part would not have to be the same as the doc's name. This allows for any local convention when naming things, e.g. dictionary:teamX:my_dict.

On creation of a new doc, the uniqueName would be pre-populated with <type>:<doc name> and update as the doc name is changed. The user would also be able to change it to something of their choosing. Creation would error if the unqieuName is not unique so the user would need to amend the uniqueName to something else.

For migration we could just set uniqueName to be <type>:<doc name> in most cases. In cases of a dup name within a type, we just append a sequential number to the end, e.g. dictionary:a_dict_1. We would need a report of all dup names so that references in content could be fixed.

Thought needed on what happens during imp/exp with these unqiue names as they are not unique outside of that stroom instance. We would probably need to auto-generate them if not present on import. If import includes them, the n we would have to deal with clashes with existing names, allowing for the fact that the incoming uniqueName may be in use in other parts of the imported content.

at055612 avatar Sep 18 '24 10:09 at055612