Custom PrimaryKey Generation with autoincrement

后端 未结 6 821
小蘑菇
小蘑菇 2021-01-22 21:08

I need to define and generate primary key for 2 or more tables.

Tables hold same type of data but FOR Some BUSINESS RULES we have to make them separate say like

6条回答
  •  梦谈多话
    2021-01-22 21:33

    you could have a composite key over the zone id and auto id.

    could also have a trigger that sets the pk to a custom string upon insert.

    in general, would be best to keep these in the same table (since they have the same columns) and only differ by local vs. intl.

提交回复
热议问题