I have an app that uses standard id integer autoincrement values. I also have another table that manages a global_id which is currently set as an integer. I m thinking it would be preferable to use a non-integer for this global value so that it would be clear whether the item id or global id is being used based upon existence of a non-integer: for example:
site.com/item/id/123 - item id
site.com/item/id/12j45 - global id
在内部,全球身份查验表仍将保持其贴现价值(而不是确保这一点)。 但是,我很想得到一个无动于衷的全球——身份认同者。 是否有可以处理这一问题的MySQL数据类型? 同样的,一次性(潜在)随机性(1至1b、2至2d)。
是否有更好的办法处理这一问题? 例如,在考虑将所涉物体与已登记的物体相提并论——因此,地点为123,但成为全球价值123。 也许有铁路部分已经这样做?
th
@Doug
yes regarding uniqueness across tables; basically, a version of the object relational impedence mismatch issue (lists of objects). There is currently two sets of ids and I manage it manually similar to what you propose as two namespaces.
The namespaces are not needed though because if one is set up as int only and the other is set up as anything else, you know you are looking at a global_id.