Problem with pluralisation in reverse engineering

9 views
Skip to first unread message

Ross Attrill

unread,
Nov 26, 2012, 12:48:29 AM11/26/12
to dbix-da...@googlegroups.com
There seems to have been a change in recent months to the pluralisation of entity names when reverse engineering a schema.

Tables named like 'PROCESS' used to get converted to processes (plural) but are now getting converted to processs in the plural or proces in the singular.

Does anybody know why this has happened?  

I will drill down and research further but just checking if anybody has already found this problem and resolved it.

Thanks in advance for any help on this.

Dami Laurent (PJ)

unread,
Nov 26, 2012, 2:01:40 AM11/26/12
to dbix-da...@googlegroups.com

Hi Ross,

 

Schema::Generator tries to use Lingua::EN::Inflect::Number to generate plurals; if it cannot use it, it falls back to just adding a 's'.

So my guess is that you should just reinstall Lingua::EN::Inflect::Number to make it work as before.

 

Cheers, Laurent Dami

 

 

De : dbix-da...@googlegroups.com [mailto:dbix-da...@googlegroups.com] De la part de Ross Attrill
Envoyé : lundi, 26. novembre 2012 06:48
À : dbix-da...@googlegroups.com
Objet : [dbix-datamodel] Problem with pluralisation in reverse engineering

Ross Attrill

unread,
Nov 26, 2012, 4:26:44 PM11/26/12
to dbix-da...@googlegroups.com
Thank you Laurent - that fixed it.

Would you consider making Lingua::EN::Inflect::Number a mandatory dependency?   It works much better with it installed.

Regards,

Ross.

Dami Laurent (PJ)

unread,
Nov 27, 2012, 3:22:17 AM11/27/12
to dbix-da...@googlegroups.com

De : dbix-da...@googlegroups.com [mailto:dbix-da...@googlegroups.com] De la part de Ross Attrill

Would you consider making Lingua::EN::Inflect::Number a mandatory dependency?   It works much better with it installed.

 

OK, I'll do that. I was reluctant to introduce the dependency because are not many users of Schema::Generator (probably you are the only one:-). But Lingua::EN::Inflect::Number doesn't pull half of CPAN with it, so it's a reasonable dependency to add.

 

 

Ross Attrill

unread,
Nov 27, 2012, 4:57:54 PM11/27/12
to dbix-da...@googlegroups.com
Thank you Laurent.

I think Schema::Generator works really well and is one of the many advantages that DBIDM has over DBIC.   There is a  change I want to suggest.   When table names with two words are plurarised - eg. JOB_STATUS the plural becomes jobsStatuses whereas I think it should be jobStatuses.   I have been hesitant to suggest this because I thought it would break the schemas for lots of other users.   If you would support this change I would be happy to look into how to do this and write a pull request if I can.

Regards,

Ross.

laurent dami

unread,
Nov 27, 2012, 11:22:30 PM11/27/12
to dbix-da...@googlegroups.com
Hi Ross,

Your particular example makes sense, but I'm not sure if this can be
turned into a general rule. Anyway the change is welcome if you want to
investigate that. Maybe modules like
https://metacpan.org/module/Lingua::EN::Inflect and
https://metacpan.org/module/Lingua::EN::Inflect::Phrase could help.

Cheers, Laurent D.

Le 27.11.2012 22:57, Ross Attrill a �crit :

Ross Attrill

unread,
Nov 28, 2012, 5:15:37 AM11/28/12
to dbix-da...@googlegroups.com
Hi Laurent,

I was thinking of just applying Lingua::EN::Inflect to the last split part of the table name only.

I have sent through a pull request for your consideration.   I have tested this on my current work database schema and the results make good sense to me.

Also, I apologize that my git pull requests are muddled.   I am still getting the hang of git and github.


Regards,

Ross Attrill


On Wed, Nov 28, 2012 at 3:22 PM, laurent dami <lauren...@free.fr> wrote:
Hi Ross,

Your particular example makes sense, but I'm not sure if this can be turned into a general rule. Anyway the change is welcome if you want to investigate that. Maybe modules like https://metacpan.org/module/Lingua::EN::Inflect and https://metacpan.org/module/Lingua::EN::Inflect::Phrase could help.

Cheers, Laurent D.

Reply all
Reply to author
Forward
0 new messages