tüm tablolar birincil anahtar için iki sütun yaşıyorsanız ben nerede veritabanı yapısı var.
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.
php kod zaman () gibi. 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
Bunun için iyi bir alternatif var
Selamlar