1 package Fumo
::Schema
::File
;
6 use base
'DBIx::Class';
8 __PACKAGE__
->load_components("Core");
9 __PACKAGE__
->table("file");
10 __PACKAGE__
->add_columns(
12 { data_type
=> "VARCHAR", default_value
=> "", is_nullable
=> 0, size
=> 128 },
14 { data_type
=> "VARCHAR", default_value
=> "", is_nullable
=> 0, size
=> 128 },
16 { data_type
=> "VARCHAR", default_value
=> "", is_nullable
=> 0, size
=> 128 },
18 { data_type
=> "VARCHAR", default_value
=> "", is_nullable
=> 0, size
=> 128 },
20 { data_type
=> "INT", default_value
=> "", is_nullable
=> 0, size
=> 11 },
22 { data_type
=> "DATETIME", default_value
=> "", is_nullable
=> 0, size
=> 19 },
24 { data_type
=> "FLOAT", default_value
=> 0, is_nullable
=> 0, size
=> 32 },
26 __PACKAGE__
->set_primary_key("name", "project", "branch", "revision");
27 __PACKAGE__
->belongs_to("branch", "Fumo::Schema::Branch", { name
=> "branch" });
28 __PACKAGE__
->belongs_to("project", "Fumo::Schema::Project", { name
=> "project" });
29 __PACKAGE__
->belongs_to("revision", "Fumo::Schema::Revision", { name
=> "revision" });
30 __PACKAGE__
->has_many(
33 { "foreign.file" => "self.name" },
37 # Created by DBIx::Class::Schema::Loader v0.04001 @ 2007-07-20 22:25:16
38 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:47+jRPE2lQskHivy9bN5hw
45 $self->created(DateTime
->now);
47 return $self->next::method
(@_);
51 my ($self, $project, $branch, $revision) = @_;
53 $self->search_related('tests',
54 { directive
=> undef },
56 select => [ 'status', { count
=> 'status' } ],
57 as
=> [ 'status', 'status_count' ],
64 my ($self, $status, $project, $branch, $revision) = @_;
66 # only allow the valid test types through
74 $search->{status
} = $status;
75 $search->{directive
} = undef;
78 return $self->search_related('tests', $search, {