hi,
i have database structure where all the tables are having two columns for primary key.
for an example the table Author has two columns like AutherId which is a auto increment number and the pc_id which is unique to that pc the those are the composite keys for the table. but when it comes to relations i have to define the both columns for each and every relation. and since im planning to use Docrtine (PHP ORM) it is bit problematic to use it like that.
so i wonder if i could generate a unique id (combining the pc_id as well) and use it as the primary key.
the php code is like time() . rand(1000,9999) . $pc_id
so that the id is generated by concatenating time + a random number between 1000 and 9999 and the pc_id (pc_id is also a number starting from 1). but this makes a 20 digit number (when the pc_id is 6 digit) which needs bigint to store
is there a good alternative for this
Regards