I suppose its this part which is difficult and looks like we need to do it to fit into the character limits on various dbs:
columnames_abbreviated will be an abbreviated representation of the columns used by the object (index, key, sequence) generated by the concatenation of the first 3 chars of each field. For example, one index over the "name, level, context" fields be converted to the "namlevcon" abbreviation.
If any of the calculated names excess the infamous 30cc. the name will be reduced by removing characters from the "columnames_abbreviated" part until if fits completely.