Commit | Line | Data |
7adfd53f |
1 | package # hide from PAUSE |
2 | RTest::TestDB::Bar; |
3 | |
4 | use DBIx::Class 0.07; |
5 | |
6 | use base qw/DBIx::Class Reaction::Object/; |
7 | use Reaction::Class; |
8 | use Reaction::Types::DateTime; |
9 | use Reaction::Types::File; |
10 | |
11 | has 'name' => (isa => 'NonEmptySimpleStr', is => 'rw', required => 1); |
12 | has 'foo' => (isa => 'RTest::TestDB::Foo', is => 'rw', required => 1); |
13 | has 'published_at' => (isa => 'DateTime', is => 'rw'); |
14 | has 'avatar' => (isa => 'File', is => 'rw'); |
15 | |
16 | __PACKAGE__->load_components(qw/InflateColumn::DateTime Core/); |
17 | |
18 | __PACKAGE__->table('bar'); |
19 | |
20 | __PACKAGE__->add_columns( |
21 | name => { data_type => 'varchar', size => 255 }, |
22 | foo_id => { data_type => 'integer', size => 16 }, |
23 | published_at => { data_type => 'datetime', is_nullable => 1 }, |
24 | avatar => { data_type => 'blob', is_nullable => 1 }, |
25 | ); |
26 | |
27 | __PACKAGE__->set_primary_key('name'); |
28 | |
29 | __PACKAGE__->belongs_to( |
30 | 'foo' => 'RTest::TestDB::Foo', |
31 | { 'foreign.id' => 'self.foo_id' } |
32 | ); |
33 | |
a5200252 |
34 | __PACKAGE__->meta->make_immutable; |
35 | |
36 | |
7adfd53f |
37 | 1; |