[Dbix-class] Result->id

James Gilbert jgrg at sanger.ac.uk
Wed Nov 29 13:53:29 GMT 2017


I always give my id columns a longer name incorporating the entity, such as "id_person".  If you only call them "id", you will have many tables with column "id", making it hard to see how the tables are supposed to link together when looking at the schema.

	James


> On 29 Nov 2017, at 11:39, Vladimir Melnik <v.melnik at uplink.ua> wrote:
> 
> Thank you!
> 
> That's why I can't decide should I rename the `id` column to `_id` or should I only change the 1st parameter of the `add_columns()` call from `id` to `_id`. Or should I make my own method (and call it, let's say, `PKs`) to do the same thing that `DBIx::Class::PK::id` does?
> 
> It's always difficult to decide what way is better when all ways are "correct". :-)
> 
> Being grateful for all your comments and suggestions regarding this topic,
> Vlad



-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 



More information about the DBIx-Class mailing list