File: Band.pm

package info (click to toggle)
libhtml-formfu-model-dbic-perl 0.09002-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,064 kB
  • sloc: perl: 2,270; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 590 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package MySchema::Band;
use strict;
use warnings;

use base 'DBIx::Class';

__PACKAGE__->load_components(qw/ Core /);

__PACKAGE__->table("band");

__PACKAGE__->add_columns(
    id      => { data_type => "INTEGER", is_nullable => 0 },
    manager => { data_type => "INTEGER", is_nullable => 1 },
    band    => { data_type => "TEXT", is_nullable => 0 },
);

__PACKAGE__->set_primary_key("id");

__PACKAGE__->belongs_to( manager => 'MySchema::Manager' );

__PACKAGE__->has_many( user_bands => 'MySchema::UserBand', 'band' );

__PACKAGE__->many_to_many( users => 'user_bands', 'user' );

1;