[Dbix-class] No such column
Jason Kohles
email at jasonkohles.com
Thu Sep 13 16:56:19 GMT 2007
On Sep 13, 2007, at 11:25 AM, Craig wrote:
> Hi Sebastian:
> I do have the set_primary_key call before the add_columns call.
> Should it be the reverse?
Actually, in your case moving it down wouldn't make a difference, as
'job_id' doesn't appear in your column list anyway, you can't declare
a non-existent column as your primary key, you need this...
__PACKAGE__->add_columns(qw/
job_id date_in editted company location stateprov
country type telecommute position contact email
site url repsonded date_heard interview impression
details
/);
__PACKAGE__->set_primary_key( 'job_id' );
> Also I added the source below.
>
> package DB::Main::jobsearch;
> use base qw/DBIx::Class/;
>
> __PACKAGE__->load_components(qw/PK::Auto Core/);
> __PACKAGE__->table('job_search');
> __PACKAGE__->set_primary_key('job_id');
> __PACKAGE__->add_columns(qw/date_in editted company
> location stateprov country type telecommute position
> contact email site url repsonded date_heard interview
> impression details/);
> __PACKAGE__->has_many(stateprov =>
> 'DB::Main::stateprov');
> __PACKAGE__->has_many(country => 'DB::Main::country');
> __PACKAGE__->has_many(site => 'DB::Main::boards');
>
> 1;
>
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-
> class at lists.rawmode.org
>
--
Jason Kohles
email at jasonkohles.com
http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire
More information about the DBIx-Class
mailing list