db-seeder icon indicating copy to clipboard operation
db-seeder copied to clipboard

Is primary key hard-coded to "id"?

Open olleharstedt opened this issue 4 years ago • 3 comments

We have multiple tables with different primary key column than "id", e.g. "aid" or "qid". Looking at tebazil/db-seeder/src/TableConfigurator.php, line 45, Generator::PK only works for columns named "id"? Can we add a new feature to configure this column?

olleharstedt avatar Nov 17 '21 14:11 olleharstedt

I think so, yes.

What I had in mind is that when it's an 'id', there is usually a convention to call foreign keys like 'article_id' or 'user_id'. But will this also be true to assume that if we have 'aid' or 'quid' as a primary key?

vambus avatar Nov 18 '21 22:11 vambus

Our legacy app is very legacy, so no assumptions can be done on primary and foreign key conventions. It has to be fully configurable to be useful for us.

olleharstedt avatar Nov 19 '21 12:11 olleharstedt

Thanks for the suggestion! I plan to release the update soon.

vambus avatar Nov 19 '21 19:11 vambus