about summary refs log tree commit diff
path: root/lib/jitterbug/Schema/Result/Task.pm
blob: e63e101beae811b54b3a02e2faedbcce796dcde4 (plain) (blame)
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
27
28
29
package jitterbug::Schema::Result::Task;
use base qw/DBIx::Class::Core/;

__PACKAGE__->table('task');
__PACKAGE__->add_columns(
    taskid => {
        data_type         => 'int',
        is_auto_increment => 1,
    },
    sha256    => { data_type => 'text', is_foreign_key => 1 },
    projectid => {
        data_type      => 'int',
        is_foreign_key => 1,
    },
);

__PACKAGE__->set_primary_key('taskid');
__PACKAGE__->add_unique_constraint( [qw/projectid/] );
__PACKAGE__->add_unique_constraint( [qw/sha256/] );
__PACKAGE__->belongs_to(
    project => 'jitterbug::Schema::Result::Project',
    'projectid'
);
__PACKAGE__->belongs_to(
    commit => 'jitterbug::Schema::Result::Commit',
    'sha256'
);

1;