Show
Ignore:
Timestamp:
10/23/07 01:30:10 (2 years ago)
Author:
eevee
Message:

I discovered that DBIx::Class::Schema::Loader had been filling my table classes with lines of the form __PACKAGE__->add_unique_constraint(['id'], undef); erroneously, due to someone's inadvertently iterating over %hash rather than keys %hash. Not only were these lines redundant in the case of a primary key, but the parameters are supposed to be a name and a list of columns: thus I had a lot of constraints with ARRAY(0x...) as names and no columns. This was thoroughly breaking $schema->deploy, as it was trying to create indices with garbage names that looked like functions. I have, obviously, removed them all.
In the process, I have done something I've been meaning to do for a while: cleaned up the source in every single file to match my usual style. No auto-gen comment, no redundant loading of PK::Auto, no double-newline after the 1;, proper POD, use of qw// for passing lists, etc. This is actually a teeny part of my db cleanup tracking bug. (#58)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/lib/Vee/Schema/ThreadViews.pm

    r287 r350  
    33use strict; 
    44use warnings; 
    5  
    65use base 'DBIx::Class'; 
    76 
    8 __PACKAGE__->load_components("PK::Auto", "Core"); 
    9 __PACKAGE__->table("thread_views"); 
     7=head1 NAME 
     8 
     9Vee::Schema::ThreadViews - DBIC class for the C<thread_views> table 
     10 
     11=cut 
     12 
     13__PACKAGE__->load_components('Core'); 
     14__PACKAGE__->table('thread_views'); 
    1015__PACKAGE__->add_columns(qw/ thread_id user_id last_viewed /); 
    11 __PACKAGE__->set_primary_key('thread_id', 'user_id'); 
    12 __PACKAGE__->add_unique_constraint(['thread_id', 'user_id'], undef); 
     16__PACKAGE__->set_primary_key(qw/ thread_id user_id /); 
    1317 
    1418__PACKAGE__->belongs_to(thread => 'Vee::Schema::Threads', 'thread_id', { join_type => 'LEFT' }); 
     
    1620# TODO: thread and user need to join to me! 
    1721 
     22=head1 SEE ALSO 
     23 
     24L<Vee::Schema>, L<DBIx::Class> 
     25 
     26=head1 AUTHOR 
     27 
     28Maintainer: Alex "Eevee" Munroe (C<veekun@veekun.com>) 
     29 
     30See the included F<AUTHORS> file for a full list of contributers. 
     31 
     32=head1 LICENSE 
     33 
     34See the included F<LICENSE> file. 
     35 
     36=cut 
     37 
    18381; 
    19