Skip to content

Instantly share code, notes, and snippets.

@EdwardIII
Created March 21, 2011 22:23
Show Gist options
  • Save EdwardIII/880358 to your computer and use it in GitHub Desktop.
Save EdwardIII/880358 to your computer and use it in GitHub Desktop.
package PartsDB::Schema::Result::Part;
use strict;
use warnings;
use base qw/DBIx::Class::Core/;
__PACKAGE__->table('parts');
__PACKAGE__->add_columns(id => {is_auto_increment => 1});
__PACKAGE__->add_columns(qw/category_id name sku/);
__PACKAGE__->set_primary_key('id');
__PACKAGE__->belongs_to(category => 'PartsDB::Schema::Result::Category', 'category_id');
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment