1 package # hide from PAUSE
6 use base qw/DBIx::Class Reaction::Object/;
8 use Reaction::Types::DateTime;
9 use Reaction::Types::File;
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');
16 __PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
18 __PACKAGE__->table('bar');
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 },
27 __PACKAGE__->set_primary_key('name');
29 __PACKAGE__->belongs_to(
30 'foo' => 'RTest::TestDB::Foo',
31 { 'foreign.id' => 'self.foo_id' }
34 __PACKAGE__->meta->make_immutable;