Skip Menu |

This queue is for tickets about the DBIx-Class-Schema-Loader CPAN distribution.

Report information
The Basics
Id: 55284
Status: resolved
Priority: 0/
Queue: DBIx-Class-Schema-Loader

People
Owner: Nobody in particular
Requestors: ovid [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.05003
Fixed in: (no value)



Subject: Prepositions should not be plural
Need to rethink some of the naming. I just got the following warning in 0.05003: DBIx::Class::Schema::Loader::RelBuilder 0.05003: warning, stripping trailing _id from Veure::Schema::Result::User relation 'email_to_ids', renaming to 'email_toes'. This behavior is new as of 0.05003. DBIx::Class::Schema::Loader::RelBuilder 0.05003: warning, stripping trailing _id from Veure::Schema::Result::User relation 'email_from_ids', renaming to 'email_froms'. This behavior is new as of 0.05003. "email_froms" is bad enough, but "email_toes"? If you're going to infer names, prepositions should not be plural. "emails_to" and "emails_from" would make this easier. Cheers, Ovid
Subject: Re: [rt.cpan.org #55284] Prepositions should not be plural
Date: Sat, 6 Mar 2010 13:26:23 -0500
To: Curtis 'Ovid' Poe via RT <bug-DBIx-Class-Schema-Loader [...] rt.cpan.org>
From: Rafael Kitover <rkitover [...] io.com>
That's pretty funny :) Will try to fix this. Are the column names 'email_from' and 'email_to'? On Sat, Mar 06, 2010 at 10:16:56AM -0500, Curtis 'Ovid' Poe via RT wrote: Show quoted text
> Sat Mar 06 10:16:55 2010: Request 55284 was acted upon. > Transaction: Ticket created by OVID > Queue: DBIx-Class-Schema-Loader > Subject: Prepositions should not be plural > Broken in: 0.05003 > Severity: Normal > Owner: Nobody > Requestors: ovid@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=55284 > > > > Need to rethink some of the naming. I just got the following warning in > 0.05003: > > DBIx::Class::Schema::Loader::RelBuilder 0.05003: warning, stripping > trailing _id from Veure::Schema::Result::User relation 'email_to_ids', > renaming to 'email_toes'. This behavior is new as of 0.05003. > DBIx::Class::Schema::Loader::RelBuilder 0.05003: warning, stripping > trailing _id from Veure::Schema::Result::User relation 'email_from_ids', > renaming to 'email_froms'. This behavior is new as of 0.05003. > > "email_froms" is bad enough, but "email_toes"? > > If you're going to infer names, prepositions should not be plural. > "emails_to" and "emails_from" would make this easier. > > Cheers, > Ovid
Subject: Re: [rt.cpan.org #55284] Prepositions should not be plural
Date: Sat, 6 Mar 2010 10:33:21 -0800 (PST)
To: bug-DBIx-Class-Schema-Loader [...] rt.cpan.org
From: Ovid <curtis_ovid_poe [...] yahoo.com>
Show quoted text
----- Original Message ----
> From: Rafael Kitover via RT <bug-DBIx-Class-Schema-Loader@rt.cpan.org> > > That's pretty funny :) > > Will try to fix this. > > Are the column names 'email_from' and 'email_to'?
The column names are "from_id" and "to_id'. The relevant tables are below. And I was laughing when I saw it. Fortunately, it's a personal project and this is part of the system I'm not working on yet :) veure=# \d email Table "public.email" Column | Type | Modifiers ----------+-----------------------------+---------------------------------------------------- id | integer | not null default nextval('email_id_seq'::regclass) from_id | integer | not null to_id | integer | not null datesent | timestamp without time zone | not null default now() message | text | not null Indexes: "email_pkey" PRIMARY KEY, btree (id) Foreign-key constraints: "email_from_id_fkey" FOREIGN KEY (from_id) REFERENCES users(id) "email_to_id_fkey" FOREIGN KEY (to_id) REFERENCES users(id) veure=# \d users Table "public.users" Column | Type | Modifiers ----------------------+------------------------+---------------------------------------------------- id | integer | not null default nextval('users_id_seq'::regclass) username | character varying(100) | not null password | character varying(100) | not null email | character varying(255) | not null current_character_id | integer | Indexes: "users_pkey" PRIMARY KEY, btree (id) "users_email_key" UNIQUE, btree (email) "users_username_key" UNIQUE, btree (username) Foreign-key constraints: "current_character_fk" FOREIGN KEY (current_character_id) REFERENCES characters(id) DEFERRABLE INITIALLY DEFERRED Referenced by: TABLE "characters" CONSTRAINT "characters_user_id_fkey" FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED TABLE "email" CONSTRAINT "email_from_id_fkey" FOREIGN KEY (from_id) REFERENCES users(id) TABLE "email" CONSTRAINT "email_to_id_fkey" FOREIGN KEY (to_id) REFERENCES users(id) TABLE "user_role" CONSTRAINT "user_role_user_id_fkey" FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED Cheers, Ovid-- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog - http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6
Subject: Re: [rt.cpan.org #55284] Prepositions should not be plural
Date: Sun, 7 Mar 2010 18:01:19 -0500
To: Ovid via RT <bug-DBIx-Class-Schema-Loader [...] rt.cpan.org>
From: Rafael Kitover <rkitover [...] io.com>
Hi Ovid, could you please try the git version: git://git.shadowcat.co.uk/dbsrgits/DBIx-Class-Schema-Loader.git the fix seems to be simple, just a matter of replacing '_'s with ' 's when calling to_PL from Lingua::EN::Inflect::Number to get more reasonable behavior. Once I get a couple of people to try out this version of the RelBuilder, and finish the Firebird support I'm working on, I'll release 0.05004. Cheers, On Sat, Mar 06, 2010 at 01:34:19PM -0500, Ovid via RT wrote: Show quoted text
> Queue: DBIx-Class-Schema-Loader > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=55284 > > > ----- Original Message ----
> > From: Rafael Kitover via RT <bug-DBIx-Class-Schema-Loader@rt.cpan.org> > > > > That's pretty funny :) > > > > Will try to fix this. > > > > Are the column names 'email_from' and 'email_to'?
> > > The column names are "from_id" and "to_id'. The relevant tables are below. And I was laughing when I saw it. Fortunately, it's a personal project and this is part of the system I'm not working on yet :)
...
Subject: Re: [rt.cpan.org #55284] Prepositions should not be plural
Date: Sun, 7 Mar 2010 22:48:00 -0800 (PST)
To: bug-DBIx-Class-Schema-Loader [...] rt.cpan.org, ovid [...] cpan.org
From: Ovid <curtis_ovid_poe [...] yahoo.com>
Show quoted text
----- Original Message ----
> From: Rafael Kitover via RT <bug-DBIx-Class-Schema-Loader@rt.cpan.org>
> could you please try the git version: > > git://git.shadowcat.co.uk/dbsrgits/DBIx-Class-Schema-Loader.git > > the fix seems to be simple, just a matter of replacing '_'s with ' 's when > calling to_PL from Lingua::EN::Inflect::Number to get more reasonable > behavior. > > Once I get a couple of people to try out this version of the RelBuilder, > and finish the Firebird support I'm working on, I'll release 0.05004.
Ah, "emails_to" is much better. Thank you :) A couple of questions. First, why is "integer" now quoted below? (for dogs) Just aesthetics? Right now I'm trying to minimize "non-changes" in my schema code so that other developers aren't trolling through large, non-functional commits. - data_type: integer + data_type: 'integer' default_value: nextval('visa_id_seq'::regclass) is_auto_increment: 1 is_nullable: 0 Also, I'm getting one test failure: t/10sqlite_common.t ..................... 1/167 Can't locate object method "has_relationship" via package "DBIXCSL_Test::Schema::LoaderTest4" at t/lib/dbixcsl_common_tests.pm line 514. Below my sig is the tail of the test run. Cheers, Ovid-- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog - http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6 ok 70 - Foreign key detected ok 71 - The object isa DBIXCSL_Test::Schema::LoaderTest4 Can't locate object method "has_relationship" via package "DBIXCSL_Test::Schema::LoaderTest4" at t/lib/dbixcsl_common_tests.pm line 514. # Looks like you planned 167 tests but ran 71. # Looks like your test exited with 2 just after 71. Dubious, test returned 2 (wstat 512, 0x200) Failed 96/167 subtests Test Summary Report ------------------- t/10sqlite_common.t (Wstat: 512 Tests: 71 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 167 tests but ran 71. Files=1, Tests=71, 1 wallclock secs ( 0.04 usr 0.01 sys + 0.71 cusr 0.21 csys = 0.97 CPU) Result: FAIL
Subject: Re: [rt.cpan.org #55284] Prepositions should not be plural
Date: Mon, 8 Mar 2010 03:21:22 -0500
To: Ovid via RT <bug-DBIx-Class-Schema-Loader [...] rt.cpan.org>
From: Rafael Kitover <rkitover [...] io.com>
On Mon, Mar 08, 2010 at 01:49:14AM -0500, Ovid via RT wrote: Show quoted text
> Queue: DBIx-Class-Schema-Loader > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=55284 > > > ----- Original Message ----
> > From: Rafael Kitover via RT <bug-DBIx-Class-Schema-Loader@rt.cpan.org>
> >
> > could you please try the git version: > > > > git://git.shadowcat.co.uk/dbsrgits/DBIx-Class-Schema-Loader.git > >
... Show quoted text
> > Ah, "emails_to" is much better. Thank you :) > > A couple of questions. First, why is "integer" now quoted below? (for dogs) Just aesthetics? Right now I'm trying to minimize "non-changes" in my schema code so that other developers aren't trolling through large, non-functional commits. > > - data_type: integer > + data_type: 'integer' > default_value: nextval('visa_id_seq'::regclass) > is_auto_increment: 1 > is_nullable: 0
The previous fix didn't take into account the difference between refs and literals in the POD formatting. If it's really annoying I can remove the quotes. Show quoted text
> Also, I'm getting one test failure: > > t/10sqlite_common.t ..................... 1/167 Can't locate object method "has_relationship" via package "DBIXCSL_Test::Schema::LoaderTest4" at t/lib/dbixcsl_common_tests.pm line 514.
Was using I think a DBIC trunk feature, should be fixed now.
Fixed in 0.06000, all inflection is done with Lingua::EN::Inflect::Phrase