DBIx::Class: migrate to use_namespaces
This gives us a place to put helper functions that act on entire tables, not just individual records. This should be a backwards compatible change, except in places we're manually using result class names.
This commit is contained in:
111
src/lib/Hydra/Schema/Result/AggregateConstituents.pm
Normal file
111
src/lib/Hydra/Schema/Result/AggregateConstituents.pm
Normal file
@ -0,0 +1,111 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::AggregateConstituents;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::AggregateConstituents
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<aggregateconstituents>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("aggregateconstituents");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 aggregate
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 constituent
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"aggregate",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"constituent",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</aggregate>
|
||||
|
||||
=item * L</constituent>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("aggregate", "constituent");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 aggregate
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"aggregate",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "aggregate" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
=head2 constituent
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"constituent",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "constituent" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ksBE6gQqcu58rdZfbqEK/w
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
1;
|
202
src/lib/Hydra/Schema/Result/BuildInputs.pm
Normal file
202
src/lib/Hydra/Schema/Result/BuildInputs.pm
Normal file
@ -0,0 +1,202 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::BuildInputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::BuildInputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<buildinputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("buildinputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 id
|
||||
|
||||
data_type: 'integer'
|
||||
is_auto_increment: 1
|
||||
is_nullable: 0
|
||||
sequence: 'buildinputs_id_seq'
|
||||
|
||||
=head2 build
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 1
|
||||
|
||||
=head2 name
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 type
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 uri
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 revision
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 value
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 emailresponsible
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 0
|
||||
is_nullable: 0
|
||||
|
||||
=head2 dependency
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 1
|
||||
|
||||
=head2 path
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 sha256hash
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"id",
|
||||
{
|
||||
data_type => "integer",
|
||||
is_auto_increment => 1,
|
||||
is_nullable => 0,
|
||||
sequence => "buildinputs_id_seq",
|
||||
},
|
||||
"build",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
|
||||
"name",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"type",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"uri",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"revision",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"value",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"emailresponsible",
|
||||
{ data_type => "integer", default_value => 0, is_nullable => 0 },
|
||||
"dependency",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
|
||||
"path",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"sha256hash",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</id>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("id");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 build
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"build",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "build" },
|
||||
{
|
||||
is_deferrable => 0,
|
||||
join_type => "LEFT",
|
||||
on_delete => "CASCADE",
|
||||
on_update => "NO ACTION",
|
||||
},
|
||||
);
|
||||
|
||||
=head2 dependency
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"dependency",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "dependency" },
|
||||
{
|
||||
is_deferrable => 0,
|
||||
join_type => "LEFT",
|
||||
on_delete => "NO ACTION",
|
||||
on_update => "NO ACTION",
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IBNdR4VPMGusDQex5omT+g
|
||||
|
||||
my %hint = (
|
||||
columns => [
|
||||
'type',
|
||||
'uri',
|
||||
'value',
|
||||
'revision',
|
||||
'dependency',
|
||||
],
|
||||
);
|
||||
|
||||
sub json_hint {
|
||||
return \%hint;
|
||||
}
|
||||
|
||||
1;
|
171
src/lib/Hydra/Schema/Result/BuildMetrics.pm
Normal file
171
src/lib/Hydra/Schema/Result/BuildMetrics.pm
Normal file
@ -0,0 +1,171 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::BuildMetrics;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::BuildMetrics
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<buildmetrics>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("buildmetrics");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 build
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 name
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 unit
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 value
|
||||
|
||||
data_type: 'double precision'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 project
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 jobset
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 job
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 timestamp
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"build",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"name",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"unit",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"value",
|
||||
{ data_type => "double precision", is_nullable => 0 },
|
||||
"project",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"jobset",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"job",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"timestamp",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</build>
|
||||
|
||||
=item * L</name>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("build", "name");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 build
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"build",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "build" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
=head2 jobset
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Jobsets>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"jobset",
|
||||
"Hydra::Schema::Result::Jobsets",
|
||||
{ name => "jobset", project => "project" },
|
||||
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
=head2 project
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Projects>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"project",
|
||||
"Hydra::Schema::Result::Projects",
|
||||
{ name => "project" },
|
||||
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yp/kl6bkrm/CSEle7Y3How
|
||||
|
||||
sub json_hint {
|
||||
return { columns => ['value', 'unit'] };
|
||||
}
|
||||
|
||||
1;
|
110
src/lib/Hydra/Schema/Result/BuildOutputs.pm
Normal file
110
src/lib/Hydra/Schema/Result/BuildOutputs.pm
Normal file
@ -0,0 +1,110 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::BuildOutputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::BuildOutputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<buildoutputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("buildoutputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 build
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 name
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 path
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"build",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"name",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"path",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</build>
|
||||
|
||||
=item * L</name>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("build", "name");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 build
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"build",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "build" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gU+kZ6A0ISKpaXGRGve8mg
|
||||
|
||||
my %hint = (
|
||||
columns => [
|
||||
'path'
|
||||
],
|
||||
);
|
||||
|
||||
sub json_hint {
|
||||
return \%hint;
|
||||
}
|
||||
|
||||
1;
|
158
src/lib/Hydra/Schema/Result/BuildProducts.pm
Normal file
158
src/lib/Hydra/Schema/Result/BuildProducts.pm
Normal file
@ -0,0 +1,158 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::BuildProducts;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::BuildProducts
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<buildproducts>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("buildproducts");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 build
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 productnr
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 type
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 subtype
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 filesize
|
||||
|
||||
data_type: 'bigint'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 sha256hash
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 path
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 name
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 defaultpath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"build",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"productnr",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"type",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"subtype",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"filesize",
|
||||
{ data_type => "bigint", is_nullable => 1 },
|
||||
"sha256hash",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"path",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"name",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"defaultpath",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</build>
|
||||
|
||||
=item * L</productnr>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("build", "productnr");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 build
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"build",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "build" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6vyZPg5I2zbgpw1a6JsVjw
|
||||
|
||||
my %hint = (
|
||||
columns => [
|
||||
'type',
|
||||
'subtype',
|
||||
'name',
|
||||
'filesize',
|
||||
'sha256hash',
|
||||
'path',
|
||||
'defaultpath'
|
||||
],
|
||||
);
|
||||
|
||||
sub json_hint {
|
||||
return \%hint;
|
||||
}
|
||||
|
||||
1;
|
127
src/lib/Hydra/Schema/Result/BuildStepOutputs.pm
Normal file
127
src/lib/Hydra/Schema/Result/BuildStepOutputs.pm
Normal file
@ -0,0 +1,127 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::BuildStepOutputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::BuildStepOutputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<buildstepoutputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("buildstepoutputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 build
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 stepnr
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 name
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 path
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"build",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"stepnr",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"name",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"path",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</build>
|
||||
|
||||
=item * L</stepnr>
|
||||
|
||||
=item * L</name>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("build", "stepnr", "name");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 build
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"build",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "build" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
=head2 buildstep
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildSteps>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"buildstep",
|
||||
"Hydra::Schema::Result::BuildSteps",
|
||||
{ build => "build", stepnr => "stepnr" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gxp8rOjpRVen4YbIjomHTw
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
1;
|
238
src/lib/Hydra/Schema/Result/BuildSteps.pm
Normal file
238
src/lib/Hydra/Schema/Result/BuildSteps.pm
Normal file
@ -0,0 +1,238 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::BuildSteps;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::BuildSteps
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<buildsteps>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("buildsteps");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 build
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 stepnr
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 type
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 drvpath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 busy
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 status
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 errormsg
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 starttime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 stoptime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 machine
|
||||
|
||||
data_type: 'text'
|
||||
default_value: (empty string)
|
||||
is_nullable: 0
|
||||
|
||||
=head2 system
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 propagatedfrom
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 1
|
||||
|
||||
=head2 overhead
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 timesbuilt
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 isnondeterministic
|
||||
|
||||
data_type: 'boolean'
|
||||
is_nullable: 1
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"build",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"stepnr",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"type",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"drvpath",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"busy",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"status",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"errormsg",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"starttime",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"stoptime",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"machine",
|
||||
{ data_type => "text", default_value => "", is_nullable => 0 },
|
||||
"system",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"propagatedfrom",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
|
||||
"overhead",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"timesbuilt",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"isnondeterministic",
|
||||
{ data_type => "boolean", is_nullable => 1 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</build>
|
||||
|
||||
=item * L</stepnr>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("build", "stepnr");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 build
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"build",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "build" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
=head2 buildstepoutputs
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildStepOutputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildstepoutputs",
|
||||
"Hydra::Schema::Result::BuildStepOutputs",
|
||||
{ "foreign.build" => "self.build", "foreign.stepnr" => "self.stepnr" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 propagatedfrom
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"propagatedfrom",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "propagatedfrom" },
|
||||
{
|
||||
is_deferrable => 0,
|
||||
join_type => "LEFT",
|
||||
on_delete => "CASCADE",
|
||||
on_update => "NO ACTION",
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GzztRd7OwomaT3Xi7NB2RQ
|
||||
|
||||
my %hint = (
|
||||
columns => [
|
||||
"machine",
|
||||
"system",
|
||||
"stepnr",
|
||||
"drvpath",
|
||||
"starttime",
|
||||
],
|
||||
eager_relations => {
|
||||
build => 'id'
|
||||
}
|
||||
);
|
||||
|
||||
sub json_hint {
|
||||
return \%hint;
|
||||
}
|
||||
|
||||
1;
|
631
src/lib/Hydra/Schema/Result/Builds.pm
Normal file
631
src/lib/Hydra/Schema/Result/Builds.pm
Normal file
@ -0,0 +1,631 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::Builds;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::Builds
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("builds");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 id
|
||||
|
||||
data_type: 'integer'
|
||||
is_auto_increment: 1
|
||||
is_nullable: 0
|
||||
sequence: 'builds_id_seq'
|
||||
|
||||
=head2 finished
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 timestamp
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 project
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 jobset
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 jobset_id
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 job
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 nixname
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 description
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 drvpath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 system
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 license
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 homepage
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 maintainers
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 maxsilent
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 3600
|
||||
is_nullable: 1
|
||||
|
||||
=head2 timeout
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 36000
|
||||
is_nullable: 1
|
||||
|
||||
=head2 ischannel
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 0
|
||||
is_nullable: 0
|
||||
|
||||
=head2 iscurrent
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 0
|
||||
is_nullable: 1
|
||||
|
||||
=head2 priority
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 0
|
||||
is_nullable: 0
|
||||
|
||||
=head2 globalpriority
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 0
|
||||
is_nullable: 0
|
||||
|
||||
=head2 starttime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 stoptime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 iscachedbuild
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 buildstatus
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 size
|
||||
|
||||
data_type: 'bigint'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 closuresize
|
||||
|
||||
data_type: 'bigint'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 releasename
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 keep
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 0
|
||||
is_nullable: 0
|
||||
|
||||
=head2 notificationpendingsince
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"id",
|
||||
{
|
||||
data_type => "integer",
|
||||
is_auto_increment => 1,
|
||||
is_nullable => 0,
|
||||
sequence => "builds_id_seq",
|
||||
},
|
||||
"finished",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"timestamp",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"project",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"jobset",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"jobset_id",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"job",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"nixname",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"description",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"drvpath",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"system",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"license",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"homepage",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"maintainers",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"maxsilent",
|
||||
{ data_type => "integer", default_value => 3600, is_nullable => 1 },
|
||||
"timeout",
|
||||
{ data_type => "integer", default_value => 36000, is_nullable => 1 },
|
||||
"ischannel",
|
||||
{ data_type => "integer", default_value => 0, is_nullable => 0 },
|
||||
"iscurrent",
|
||||
{ data_type => "integer", default_value => 0, is_nullable => 1 },
|
||||
"priority",
|
||||
{ data_type => "integer", default_value => 0, is_nullable => 0 },
|
||||
"globalpriority",
|
||||
{ data_type => "integer", default_value => 0, is_nullable => 0 },
|
||||
"starttime",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"stoptime",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"iscachedbuild",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"buildstatus",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"size",
|
||||
{ data_type => "bigint", is_nullable => 1 },
|
||||
"closuresize",
|
||||
{ data_type => "bigint", is_nullable => 1 },
|
||||
"releasename",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"keep",
|
||||
{ data_type => "integer", default_value => 0, is_nullable => 0 },
|
||||
"notificationpendingsince",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</id>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("id");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 aggregateconstituents_aggregates
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::AggregateConstituents>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"aggregateconstituents_aggregates",
|
||||
"Hydra::Schema::Result::AggregateConstituents",
|
||||
{ "foreign.aggregate" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 aggregateconstituents_constituents
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::AggregateConstituents>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"aggregateconstituents_constituents",
|
||||
"Hydra::Schema::Result::AggregateConstituents",
|
||||
{ "foreign.constituent" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 buildinputs_builds
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildInputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildinputs_builds",
|
||||
"Hydra::Schema::Result::BuildInputs",
|
||||
{ "foreign.build" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 buildinputs_dependencies
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildInputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildinputs_dependencies",
|
||||
"Hydra::Schema::Result::BuildInputs",
|
||||
{ "foreign.dependency" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 buildmetrics
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildMetrics>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildmetrics",
|
||||
"Hydra::Schema::Result::BuildMetrics",
|
||||
{ "foreign.build" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 buildoutputs
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildOutputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildoutputs",
|
||||
"Hydra::Schema::Result::BuildOutputs",
|
||||
{ "foreign.build" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 buildproducts
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildProducts>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildproducts",
|
||||
"Hydra::Schema::Result::BuildProducts",
|
||||
{ "foreign.build" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 buildstepoutputs
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildStepOutputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildstepoutputs",
|
||||
"Hydra::Schema::Result::BuildStepOutputs",
|
||||
{ "foreign.build" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 buildsteps
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildSteps>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildsteps",
|
||||
"Hydra::Schema::Result::BuildSteps",
|
||||
{ "foreign.build" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 buildsteps_propagatedfroms
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildSteps>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildsteps_propagatedfroms",
|
||||
"Hydra::Schema::Result::BuildSteps",
|
||||
{ "foreign.propagatedfrom" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 jobset
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Jobsets>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"jobset",
|
||||
"Hydra::Schema::Result::Jobsets",
|
||||
{ id => "jobset_id" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
=head2 jobset_project_jobset
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Jobsets>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"jobset_project_jobset",
|
||||
"Hydra::Schema::Result::Jobsets",
|
||||
{ name => "jobset", project => "project" },
|
||||
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
=head2 jobsetevalinputs
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetEvalInputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"jobsetevalinputs",
|
||||
"Hydra::Schema::Result::JobsetEvalInputs",
|
||||
{ "foreign.dependency" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 jobsetevalmembers
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetEvalMembers>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"jobsetevalmembers",
|
||||
"Hydra::Schema::Result::JobsetEvalMembers",
|
||||
{ "foreign.build" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 project
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Projects>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"project",
|
||||
"Hydra::Schema::Result::Projects",
|
||||
{ name => "project" },
|
||||
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
=head2 aggregates
|
||||
|
||||
Type: many_to_many
|
||||
|
||||
Composing rels: L</aggregateconstituents_constituents> -> aggregate
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->many_to_many(
|
||||
"aggregates",
|
||||
"aggregateconstituents_constituents",
|
||||
"aggregate",
|
||||
);
|
||||
|
||||
=head2 constituents
|
||||
|
||||
Type: many_to_many
|
||||
|
||||
Composing rels: L</aggregateconstituents_aggregates> -> constituent
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->many_to_many(
|
||||
"constituents",
|
||||
"aggregateconstituents_aggregates",
|
||||
"constituent",
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WHdSVHhQykmUz0tR/TExVg
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"dependents",
|
||||
"Hydra::Schema::Result::BuildInputs",
|
||||
{ "foreign.dependency" => "self.id" },
|
||||
);
|
||||
|
||||
__PACKAGE__->many_to_many(dependentBuilds => 'dependents', 'build');
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"inputs",
|
||||
"Hydra::Schema::Result::BuildInputs",
|
||||
{ "foreign.build" => "self.id" },
|
||||
);
|
||||
|
||||
__PACKAGE__->has_one(
|
||||
"actualBuildStep",
|
||||
"Hydra::Schema::Result::BuildSteps",
|
||||
{ 'foreign.drvpath' => 'self.drvpath'
|
||||
, 'foreign.build' => 'self.id'
|
||||
},
|
||||
);
|
||||
|
||||
__PACKAGE__->many_to_many("jobsetevals", "jobsetevalmembers", "eval");
|
||||
|
||||
__PACKAGE__->many_to_many("constituents_", "aggregateconstituents_aggregates", "constituent");
|
||||
|
||||
sub makeSource {
|
||||
my ($name, $query) = @_;
|
||||
my $source = __PACKAGE__->result_source_instance();
|
||||
my $new_source = $source->new($source);
|
||||
$new_source->source_name($name);
|
||||
$new_source->name(\ "($query)");
|
||||
Hydra::Schema->register_extra_source($name => $new_source);
|
||||
}
|
||||
|
||||
sub makeQueries {
|
||||
my ($name, $constraint) = @_;
|
||||
|
||||
my $activeJobs = "(select distinct project, jobset, job, system from Builds where isCurrent = 1 $constraint)";
|
||||
|
||||
makeSource(
|
||||
"LatestSucceeded$name",
|
||||
<<QUERY
|
||||
select *
|
||||
from
|
||||
(select
|
||||
(select max(b.id) from builds b
|
||||
where
|
||||
project = activeJobs.project and jobset = activeJobs.jobset
|
||||
and job = activeJobs.job and system = activeJobs.system
|
||||
and finished = 1 and buildstatus = 0
|
||||
) as id
|
||||
from $activeJobs as activeJobs
|
||||
) as latest
|
||||
join Builds using (id)
|
||||
QUERY
|
||||
);
|
||||
}
|
||||
|
||||
makeQueries('', "");
|
||||
makeQueries('ForProject', "and project = ?");
|
||||
makeQueries('ForJobset', "and jobset_id = ?");
|
||||
makeQueries('ForJob', "and jobset_id = ? and job = ?");
|
||||
makeQueries('ForJobName', "and jobset_id = (select id from jobsets j where j.name = ?) and job = ?");
|
||||
|
||||
|
||||
my %hint = (
|
||||
columns => [
|
||||
'id',
|
||||
'finished',
|
||||
'timestamp',
|
||||
'starttime',
|
||||
'stoptime',
|
||||
'project',
|
||||
'jobset',
|
||||
'job',
|
||||
'nixname',
|
||||
'system',
|
||||
'priority',
|
||||
'buildstatus',
|
||||
'releasename',
|
||||
'drvpath',
|
||||
],
|
||||
relations => {
|
||||
jobsetevals => 'id'
|
||||
},
|
||||
eager_relations => {
|
||||
buildoutputs => 'name',
|
||||
buildproducts => 'productnr',
|
||||
buildmetrics => 'name',
|
||||
}
|
||||
);
|
||||
|
||||
sub json_hint {
|
||||
return \%hint;
|
||||
}
|
||||
|
||||
1;
|
91
src/lib/Hydra/Schema/Result/CachedBazaarInputs.pm
Normal file
91
src/lib/Hydra/Schema/Result/CachedBazaarInputs.pm
Normal file
@ -0,0 +1,91 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::CachedBazaarInputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::CachedBazaarInputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<cachedbazaarinputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("cachedbazaarinputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 uri
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 revision
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 sha256hash
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 storepath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"uri",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"revision",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"sha256hash",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"storepath",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</uri>
|
||||
|
||||
=item * L</revision>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("uri", "revision");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/9cCRtmGzlDGxjqBEPI2Mw
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
1;
|
106
src/lib/Hydra/Schema/Result/CachedCVSInputs.pm
Normal file
106
src/lib/Hydra/Schema/Result/CachedCVSInputs.pm
Normal file
@ -0,0 +1,106 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::CachedCVSInputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::CachedCVSInputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<cachedcvsinputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("cachedcvsinputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 uri
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 module
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 timestamp
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 lastseen
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 sha256hash
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 storepath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"uri",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"module",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"timestamp",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"lastseen",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"sha256hash",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"storepath",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</uri>
|
||||
|
||||
=item * L</module>
|
||||
|
||||
=item * L</sha256hash>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("uri", "module", "sha256hash");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yQt8poWCs/wI6WbE4/YdxA
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
1;
|
98
src/lib/Hydra/Schema/Result/CachedDarcsInputs.pm
Normal file
98
src/lib/Hydra/Schema/Result/CachedDarcsInputs.pm
Normal file
@ -0,0 +1,98 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::CachedDarcsInputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::CachedDarcsInputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<cacheddarcsinputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("cacheddarcsinputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 uri
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 revision
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 sha256hash
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 storepath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 revcount
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"uri",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"revision",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"sha256hash",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"storepath",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"revcount",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</uri>
|
||||
|
||||
=item * L</revision>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("uri", "revision");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:20pTv4R98jXytvlWbriWRg
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
1;
|
107
src/lib/Hydra/Schema/Result/CachedGitInputs.pm
Normal file
107
src/lib/Hydra/Schema/Result/CachedGitInputs.pm
Normal file
@ -0,0 +1,107 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::CachedGitInputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::CachedGitInputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<cachedgitinputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("cachedgitinputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 uri
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 branch
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 revision
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 isdeepclone
|
||||
|
||||
data_type: 'boolean'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 sha256hash
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 storepath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"uri",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"branch",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"revision",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"isdeepclone",
|
||||
{ data_type => "boolean", is_nullable => 0 },
|
||||
"sha256hash",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"storepath",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</uri>
|
||||
|
||||
=item * L</branch>
|
||||
|
||||
=item * L</revision>
|
||||
|
||||
=item * L</isdeepclone>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("uri", "branch", "revision", "isdeepclone");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IxG58lqBfLgZ8RTZm1GQKA
|
||||
|
||||
1;
|
100
src/lib/Hydra/Schema/Result/CachedHgInputs.pm
Normal file
100
src/lib/Hydra/Schema/Result/CachedHgInputs.pm
Normal file
@ -0,0 +1,100 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::CachedHgInputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::CachedHgInputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<cachedhginputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("cachedhginputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 uri
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 branch
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 revision
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 sha256hash
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 storepath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"uri",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"branch",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"revision",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"sha256hash",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"storepath",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</uri>
|
||||
|
||||
=item * L</branch>
|
||||
|
||||
=item * L</revision>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("uri", "branch", "revision");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:meKBitAelYYc4TPT8NINYQ
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
1;
|
96
src/lib/Hydra/Schema/Result/CachedPathInputs.pm
Normal file
96
src/lib/Hydra/Schema/Result/CachedPathInputs.pm
Normal file
@ -0,0 +1,96 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::CachedPathInputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::CachedPathInputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<cachedpathinputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("cachedpathinputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 srcpath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 timestamp
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 lastseen
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 sha256hash
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 storepath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"srcpath",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"timestamp",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"lastseen",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"sha256hash",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"storepath",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</srcpath>
|
||||
|
||||
=item * L</sha256hash>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("srcpath", "sha256hash");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PZAkRje22dqftpqfU2jyGg
|
||||
|
||||
1;
|
89
src/lib/Hydra/Schema/Result/CachedSubversionInputs.pm
Normal file
89
src/lib/Hydra/Schema/Result/CachedSubversionInputs.pm
Normal file
@ -0,0 +1,89 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::CachedSubversionInputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::CachedSubversionInputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<cachedsubversioninputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("cachedsubversioninputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 uri
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 revision
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 sha256hash
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 storepath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"uri",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"revision",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"sha256hash",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"storepath",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</uri>
|
||||
|
||||
=item * L</revision>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("uri", "revision");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6kWslezt4Pb1H8gTW4EU6w
|
||||
|
||||
1;
|
108
src/lib/Hydra/Schema/Result/EvaluationErrors.pm
Normal file
108
src/lib/Hydra/Schema/Result/EvaluationErrors.pm
Normal file
@ -0,0 +1,108 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::EvaluationErrors;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::EvaluationErrors
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<evaluationerrors>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("evaluationerrors");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 id
|
||||
|
||||
data_type: 'integer'
|
||||
is_auto_increment: 1
|
||||
is_nullable: 0
|
||||
sequence: 'evaluationerrors_id_seq'
|
||||
|
||||
=head2 errormsg
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 errortime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"id",
|
||||
{
|
||||
data_type => "integer",
|
||||
is_auto_increment => 1,
|
||||
is_nullable => 0,
|
||||
sequence => "evaluationerrors_id_seq",
|
||||
},
|
||||
"errormsg",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"errortime",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</id>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("id");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 jobsetevals
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetEvals>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"jobsetevals",
|
||||
"Hydra::Schema::Result::JobsetEvals",
|
||||
{ "foreign.evaluationerror_id" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QA8C+0TfW7unnM4xzOHXdA
|
||||
|
||||
__PACKAGE__->add_column(
|
||||
"+id" => { retrieve_on_insert => 1 }
|
||||
);
|
||||
|
||||
1;
|
65
src/lib/Hydra/Schema/Result/FailedPaths.pm
Normal file
65
src/lib/Hydra/Schema/Result/FailedPaths.pm
Normal file
@ -0,0 +1,65 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::FailedPaths;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::FailedPaths
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<failedpaths>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("failedpaths");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 path
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns("path", { data_type => "text", is_nullable => 0 });
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</path>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("path");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:V/Ce4LuWe5qRHFAU32xXlw
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
1;
|
186
src/lib/Hydra/Schema/Result/JobsetEvalInputs.pm
Normal file
186
src/lib/Hydra/Schema/Result/JobsetEvalInputs.pm
Normal file
@ -0,0 +1,186 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::JobsetEvalInputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::JobsetEvalInputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<jobsetevalinputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("jobsetevalinputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 eval
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 name
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 altnr
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 type
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 uri
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 revision
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 value
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 dependency
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 1
|
||||
|
||||
=head2 path
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 sha256hash
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"eval",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"name",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"altnr",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"type",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"uri",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"revision",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"value",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"dependency",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
|
||||
"path",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"sha256hash",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</eval>
|
||||
|
||||
=item * L</name>
|
||||
|
||||
=item * L</altnr>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("eval", "name", "altnr");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 dependency
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"dependency",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "dependency" },
|
||||
{
|
||||
is_deferrable => 0,
|
||||
join_type => "LEFT",
|
||||
on_delete => "NO ACTION",
|
||||
on_update => "NO ACTION",
|
||||
},
|
||||
);
|
||||
|
||||
=head2 eval
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetEvals>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"eval",
|
||||
"Hydra::Schema::Result::JobsetEvals",
|
||||
{ id => "eval" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AgMH2XIxp7519fFaYgesVw
|
||||
|
||||
my %hint = (
|
||||
columns => [
|
||||
"revision",
|
||||
"value",
|
||||
"type",
|
||||
"uri",
|
||||
'dependency',
|
||||
],
|
||||
);
|
||||
|
||||
sub json_hint {
|
||||
return \%hint;
|
||||
}
|
||||
|
||||
1;
|
118
src/lib/Hydra/Schema/Result/JobsetEvalMembers.pm
Normal file
118
src/lib/Hydra/Schema/Result/JobsetEvalMembers.pm
Normal file
@ -0,0 +1,118 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::JobsetEvalMembers;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::JobsetEvalMembers
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<jobsetevalmembers>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("jobsetevalmembers");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 eval
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 build
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 isnew
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"eval",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"build",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"isnew",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</eval>
|
||||
|
||||
=item * L</build>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("eval", "build");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 build
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"build",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ id => "build" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
=head2 eval
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetEvals>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"eval",
|
||||
"Hydra::Schema::Result::JobsetEvals",
|
||||
{ id => "eval" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QBT9/VToFEwbuXSF8IeySQ
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
1;
|
252
src/lib/Hydra/Schema/Result/JobsetEvals.pm
Normal file
252
src/lib/Hydra/Schema/Result/JobsetEvals.pm
Normal file
@ -0,0 +1,252 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::JobsetEvals;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::JobsetEvals
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<jobsetevals>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("jobsetevals");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 id
|
||||
|
||||
data_type: 'integer'
|
||||
is_auto_increment: 1
|
||||
is_nullable: 0
|
||||
sequence: 'jobsetevals_id_seq'
|
||||
|
||||
=head2 jobset_id
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 evaluationerror_id
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 1
|
||||
|
||||
=head2 timestamp
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 checkouttime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 evaltime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 hasnewbuilds
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 hash
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 nrbuilds
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 nrsucceeded
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 flake
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 nixexprinput
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 nixexprpath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"id",
|
||||
{
|
||||
data_type => "integer",
|
||||
is_auto_increment => 1,
|
||||
is_nullable => 0,
|
||||
sequence => "jobsetevals_id_seq",
|
||||
},
|
||||
"jobset_id",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||
"evaluationerror_id",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
|
||||
"timestamp",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"checkouttime",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"evaltime",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"hasnewbuilds",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"hash",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"nrbuilds",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"nrsucceeded",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"flake",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"nixexprinput",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"nixexprpath",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</id>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("id");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 evaluationerror
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::EvaluationErrors>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"evaluationerror",
|
||||
"Hydra::Schema::Result::EvaluationErrors",
|
||||
{ id => "evaluationerror_id" },
|
||||
{
|
||||
is_deferrable => 0,
|
||||
join_type => "LEFT",
|
||||
on_delete => "SET NULL",
|
||||
on_update => "NO ACTION",
|
||||
},
|
||||
);
|
||||
|
||||
=head2 jobset
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Jobsets>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"jobset",
|
||||
"Hydra::Schema::Result::Jobsets",
|
||||
{ id => "jobset_id" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||
);
|
||||
|
||||
=head2 jobsetevalinputs
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetEvalInputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"jobsetevalinputs",
|
||||
"Hydra::Schema::Result::JobsetEvalInputs",
|
||||
{ "foreign.eval" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 jobsetevalmembers
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetEvalMembers>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"jobsetevalmembers",
|
||||
"Hydra::Schema::Result::JobsetEvalMembers",
|
||||
{ "foreign.eval" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5qvXXTBDdRzgTEmJz6xC/g
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildIds",
|
||||
"Hydra::Schema::Result::JobsetEvalMembers",
|
||||
{ "foreign.eval" => "self.id" },
|
||||
);
|
||||
|
||||
__PACKAGE__->many_to_many(builds => 'buildIds', 'build');
|
||||
|
||||
my %hint = (
|
||||
columns => [
|
||||
"hasnewbuilds",
|
||||
"id"
|
||||
],
|
||||
relations => {
|
||||
"builds" => "id"
|
||||
},
|
||||
eager_relations => {
|
||||
# altnr? Does anyone care?
|
||||
jobsetevalinputs => "name"
|
||||
}
|
||||
);
|
||||
|
||||
sub json_hint {
|
||||
return \%hint;
|
||||
}
|
||||
|
||||
1;
|
127
src/lib/Hydra/Schema/Result/JobsetInputAlts.pm
Normal file
127
src/lib/Hydra/Schema/Result/JobsetInputAlts.pm
Normal file
@ -0,0 +1,127 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::JobsetInputAlts;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::JobsetInputAlts
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<jobsetinputalts>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("jobsetinputalts");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 project
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 jobset
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 input
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 altnr
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 value
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 revision
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"project",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"jobset",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"input",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"altnr",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"value",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"revision",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</project>
|
||||
|
||||
=item * L</jobset>
|
||||
|
||||
=item * L</input>
|
||||
|
||||
=item * L</altnr>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("project", "jobset", "input", "altnr");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 jobsetinput
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetInputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"jobsetinput",
|
||||
"Hydra::Schema::Result::JobsetInputs",
|
||||
{ jobset => "jobset", name => "input", project => "project" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7GE67QxkIj/ezwUX6c/a/A
|
||||
|
||||
1;
|
157
src/lib/Hydra/Schema/Result/JobsetInputs.pm
Normal file
157
src/lib/Hydra/Schema/Result/JobsetInputs.pm
Normal file
@ -0,0 +1,157 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::JobsetInputs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::JobsetInputs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<jobsetinputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("jobsetinputs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 project
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 jobset
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 name
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 type
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 emailresponsible
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 0
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"project",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"jobset",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"name",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"type",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"emailresponsible",
|
||||
{ data_type => "integer", default_value => 0, is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</project>
|
||||
|
||||
=item * L</jobset>
|
||||
|
||||
=item * L</name>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("project", "jobset", "name");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 jobset
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Jobsets>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"jobset",
|
||||
"Hydra::Schema::Result::Jobsets",
|
||||
{ name => "jobset", project => "project" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
=head2 jobsetinputalts
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetInputAlts>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"jobsetinputalts",
|
||||
"Hydra::Schema::Result::JobsetInputAlts",
|
||||
{
|
||||
"foreign.input" => "self.name",
|
||||
"foreign.jobset" => "self.jobset",
|
||||
"foreign.project" => "self.project",
|
||||
},
|
||||
undef,
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CkU+hbVTmhfOzQhkHJHCsg
|
||||
|
||||
use JSON;
|
||||
|
||||
sub as_json {
|
||||
my $self = shift;
|
||||
|
||||
my ($input) = $self->jobsetinputalts;
|
||||
|
||||
my %json = (
|
||||
# string_columns
|
||||
"name" => $self->get_column("name") // "",
|
||||
"type" => $self->get_column("type") // "",
|
||||
"value" => $input->value // "",
|
||||
|
||||
# boolean_columns
|
||||
"emailresponsible" => $self->get_column("emailresponsible") ? JSON::true : JSON::false,
|
||||
);
|
||||
|
||||
return \%json;
|
||||
}
|
||||
|
||||
1;
|
118
src/lib/Hydra/Schema/Result/JobsetRenames.pm
Normal file
118
src/lib/Hydra/Schema/Result/JobsetRenames.pm
Normal file
@ -0,0 +1,118 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::JobsetRenames;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::JobsetRenames
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<jobsetrenames>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("jobsetrenames");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 project
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 from_
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 to_
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"project",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"from_",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"to_",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</project>
|
||||
|
||||
=item * L</from_>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("project", "from_");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 jobset
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Jobsets>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"jobset",
|
||||
"Hydra::Schema::Result::Jobsets",
|
||||
{ name => "to_", project => "project" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
=head2 project
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Projects>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"project",
|
||||
"Hydra::Schema::Result::Projects",
|
||||
{ name => "project" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Czt+7mIWn1e5IlzJYlj0vw
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
1;
|
435
src/lib/Hydra/Schema/Result/Jobsets.pm
Normal file
435
src/lib/Hydra/Schema/Result/Jobsets.pm
Normal file
@ -0,0 +1,435 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::Jobsets;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::Jobsets
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<jobsets>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("jobsets");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 name
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 id
|
||||
|
||||
data_type: 'integer'
|
||||
is_auto_increment: 1
|
||||
is_nullable: 0
|
||||
sequence: 'jobsets_id_seq'
|
||||
|
||||
=head2 project
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 description
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 nixexprinput
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 nixexprpath
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 errormsg
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 errortime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 lastcheckedtime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 triggertime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 enabled
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 enableemail
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 hidden
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 0
|
||||
is_nullable: 0
|
||||
|
||||
=head2 emailoverride
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 keepnr
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 3
|
||||
is_nullable: 0
|
||||
|
||||
=head2 checkinterval
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 300
|
||||
is_nullable: 0
|
||||
|
||||
=head2 schedulingshares
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 100
|
||||
is_nullable: 0
|
||||
|
||||
=head2 fetcherrormsg
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 forceeval
|
||||
|
||||
data_type: 'boolean'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 starttime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 type
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 0
|
||||
is_nullable: 0
|
||||
|
||||
=head2 flake
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"name",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"id",
|
||||
{
|
||||
data_type => "integer",
|
||||
is_auto_increment => 1,
|
||||
is_nullable => 0,
|
||||
sequence => "jobsets_id_seq",
|
||||
},
|
||||
"project",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"description",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"nixexprinput",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"nixexprpath",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"errormsg",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"errortime",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"lastcheckedtime",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"triggertime",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"enabled",
|
||||
{ data_type => "integer", default_value => 1, is_nullable => 0 },
|
||||
"enableemail",
|
||||
{ data_type => "integer", default_value => 1, is_nullable => 0 },
|
||||
"hidden",
|
||||
{ data_type => "integer", default_value => 0, is_nullable => 0 },
|
||||
"emailoverride",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"keepnr",
|
||||
{ data_type => "integer", default_value => 3, is_nullable => 0 },
|
||||
"checkinterval",
|
||||
{ data_type => "integer", default_value => 300, is_nullable => 0 },
|
||||
"schedulingshares",
|
||||
{ data_type => "integer", default_value => 100, is_nullable => 0 },
|
||||
"fetcherrormsg",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"forceeval",
|
||||
{ data_type => "boolean", is_nullable => 1 },
|
||||
"starttime",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"type",
|
||||
{ data_type => "integer", default_value => 0, is_nullable => 0 },
|
||||
"flake",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</project>
|
||||
|
||||
=item * L</name>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("project", "name");
|
||||
|
||||
=head1 UNIQUE CONSTRAINTS
|
||||
|
||||
=head2 C<jobsets_id_unique>
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</id>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_unique_constraint("jobsets_id_unique", ["id"]);
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 buildmetrics
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildMetrics>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildmetrics",
|
||||
"Hydra::Schema::Result::BuildMetrics",
|
||||
{
|
||||
"foreign.jobset" => "self.name",
|
||||
"foreign.project" => "self.project",
|
||||
},
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 builds_jobset_ids
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"builds_jobset_ids",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ "foreign.jobset_id" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 builds_project_jobsets
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"builds_project_jobsets",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{
|
||||
"foreign.jobset" => "self.name",
|
||||
"foreign.project" => "self.project",
|
||||
},
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 jobsetevals
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetEvals>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"jobsetevals",
|
||||
"Hydra::Schema::Result::JobsetEvals",
|
||||
{ "foreign.jobset_id" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 jobsetinputs
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetInputs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"jobsetinputs",
|
||||
"Hydra::Schema::Result::JobsetInputs",
|
||||
{
|
||||
"foreign.jobset" => "self.name",
|
||||
"foreign.project" => "self.project",
|
||||
},
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 jobsetrenames
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetRenames>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"jobsetrenames",
|
||||
"Hydra::Schema::Result::JobsetRenames",
|
||||
{ "foreign.project" => "self.project", "foreign.to_" => "self.name" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 project
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Projects>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"project",
|
||||
"Hydra::Schema::Result::Projects",
|
||||
{ name => "project" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
=head2 starredjobs
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::StarredJobs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"starredjobs",
|
||||
"Hydra::Schema::Result::StarredJobs",
|
||||
{
|
||||
"foreign.jobset" => "self.name",
|
||||
"foreign.project" => "self.project",
|
||||
},
|
||||
undef,
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iI44C3BFTo6IsS1tBwWYsg
|
||||
|
||||
use JSON;
|
||||
|
||||
=head2 builds
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"builds",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ "foreign.jobset_id" => "self.id" },
|
||||
undef,
|
||||
);
|
||||
|
||||
__PACKAGE__->add_column(
|
||||
"+id" => { retrieve_on_insert => 1 }
|
||||
);
|
||||
|
||||
sub as_json {
|
||||
my $self = shift;
|
||||
|
||||
my %json = (
|
||||
# columns
|
||||
"errortime" => $self->get_column("errortime"),
|
||||
"lastcheckedtime" => $self->get_column("lastcheckedtime"),
|
||||
"triggertime" => $self->get_column("triggertime"),
|
||||
"enabled" => $self->get_column("enabled"),
|
||||
"keepnr" => $self->get_column("keepnr"),
|
||||
"checkinterval" => $self->get_column("checkinterval"),
|
||||
"schedulingshares" => $self->get_column("schedulingshares"),
|
||||
"starttime" => $self->get_column("starttime"),
|
||||
|
||||
# string_columns
|
||||
"name" => $self->get_column("name") // "",
|
||||
"project" => $self->get_column("project") // "",
|
||||
"description" => $self->get_column("description") // "",
|
||||
"nixexprinput" => $self->get_column("nixexprinput") // "",
|
||||
"nixexprpath" => $self->get_column("nixexprpath") // "",
|
||||
"errormsg" => $self->get_column("errormsg") // "",
|
||||
"emailoverride" => $self->get_column("emailoverride") // "",
|
||||
"fetcherrormsg" => $self->get_column("fetcherrormsg") // "",
|
||||
"type" => $self->get_column("type") // "",
|
||||
"flake" => $self->get_column("flake") // "",
|
||||
|
||||
# boolean_columns
|
||||
"enableemail" => $self->get_column("enableemail") ? JSON::true : JSON::false,
|
||||
"visible" => $self->get_column("hidden") ? JSON::false : JSON::true,
|
||||
|
||||
"inputs" => { map { $_->name => $_ } $self->jobsetinputs }
|
||||
);
|
||||
|
||||
return \%json;
|
||||
}
|
||||
|
||||
1;
|
112
src/lib/Hydra/Schema/Result/NewsItems.pm
Normal file
112
src/lib/Hydra/Schema/Result/NewsItems.pm
Normal file
@ -0,0 +1,112 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::NewsItems;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::NewsItems
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<newsitems>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("newsitems");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 id
|
||||
|
||||
data_type: 'integer'
|
||||
is_auto_increment: 1
|
||||
is_nullable: 0
|
||||
sequence: 'newsitems_id_seq'
|
||||
|
||||
=head2 contents
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 createtime
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 author
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"id",
|
||||
{
|
||||
data_type => "integer",
|
||||
is_auto_increment => 1,
|
||||
is_nullable => 0,
|
||||
sequence => "newsitems_id_seq",
|
||||
},
|
||||
"contents",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"createtime",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
"author",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</id>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("id");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 author
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Users>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"author",
|
||||
"Hydra::Schema::Result::Users",
|
||||
{ username => "author" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pJsP4RptP4rTmM2j4B5+oA
|
||||
|
||||
1;
|
75
src/lib/Hydra/Schema/Result/NrBuilds.pm
Normal file
75
src/lib/Hydra/Schema/Result/NrBuilds.pm
Normal file
@ -0,0 +1,75 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::NrBuilds;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::NrBuilds
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<nrbuilds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("nrbuilds");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 what
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 count
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"what",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"count",
|
||||
{ data_type => "integer", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</what>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("what");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8cLowAk8TYW7wSkJvtFWDQ
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
1;
|
111
src/lib/Hydra/Schema/Result/ProjectMembers.pm
Normal file
111
src/lib/Hydra/Schema/Result/ProjectMembers.pm
Normal file
@ -0,0 +1,111 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::ProjectMembers;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::ProjectMembers
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<projectmembers>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("projectmembers");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 project
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 username
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"project",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"username",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</project>
|
||||
|
||||
=item * L</username>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("project", "username");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 project
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Projects>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"project",
|
||||
"Hydra::Schema::Result::Projects",
|
||||
{ name => "project" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
=head2 username
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Users>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"username",
|
||||
"Hydra::Schema::Result::Users",
|
||||
{ username => "username" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2XEIyAyuVBJ9LtYV0mX/2Q
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
1;
|
282
src/lib/Hydra/Schema/Result/Projects.pm
Normal file
282
src/lib/Hydra/Schema/Result/Projects.pm
Normal file
@ -0,0 +1,282 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::Projects;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::Projects
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<projects>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("projects");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 name
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 displayname
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 description
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 enabled
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 hidden
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 0
|
||||
is_nullable: 0
|
||||
|
||||
=head2 owner
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 homepage
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 declfile
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 decltype
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 declvalue
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"name",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"displayname",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"description",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"enabled",
|
||||
{ data_type => "integer", default_value => 1, is_nullable => 0 },
|
||||
"hidden",
|
||||
{ data_type => "integer", default_value => 0, is_nullable => 0 },
|
||||
"owner",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"homepage",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"declfile",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"decltype",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"declvalue",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</name>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("name");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 buildmetrics
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::BuildMetrics>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"buildmetrics",
|
||||
"Hydra::Schema::Result::BuildMetrics",
|
||||
{ "foreign.project" => "self.name" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 builds
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Builds>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"builds",
|
||||
"Hydra::Schema::Result::Builds",
|
||||
{ "foreign.project" => "self.name" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 jobsetrenames
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::JobsetRenames>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"jobsetrenames",
|
||||
"Hydra::Schema::Result::JobsetRenames",
|
||||
{ "foreign.project" => "self.name" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 jobsets
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Jobsets>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"jobsets",
|
||||
"Hydra::Schema::Result::Jobsets",
|
||||
{ "foreign.project" => "self.name" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 owner
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Users>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"owner",
|
||||
"Hydra::Schema::Result::Users",
|
||||
{ username => "owner" },
|
||||
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
=head2 projectmembers
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::ProjectMembers>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"projectmembers",
|
||||
"Hydra::Schema::Result::ProjectMembers",
|
||||
{ "foreign.project" => "self.name" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 starredjobs
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::StarredJobs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"starredjobs",
|
||||
"Hydra::Schema::Result::StarredJobs",
|
||||
{ "foreign.project" => "self.name" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 usernames
|
||||
|
||||
Type: many_to_many
|
||||
|
||||
Composing rels: L</projectmembers> -> username
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->many_to_many("usernames", "projectmembers", "username");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nKVZ8ZNCZQQ52zbpDAaoQQ
|
||||
|
||||
use JSON;
|
||||
|
||||
sub as_json {
|
||||
my $self = shift;
|
||||
|
||||
my %json = (
|
||||
# string_columns
|
||||
"name" => $self->get_column("name") // "",
|
||||
"displayname" => $self->get_column("displayname") // "",
|
||||
"description" => $self->get_column("description") // "",
|
||||
"homepage" => $self->get_column("homepage") // "",
|
||||
"owner" => $self->get_column("owner") // "",
|
||||
|
||||
# boolean_columns
|
||||
"enabled" => $self->get_column("enabled") ? JSON::true : JSON::false,
|
||||
"hidden" => $self->get_column("hidden") ? JSON::true : JSON::false,
|
||||
|
||||
"jobsets" => [ map { $_->name } $self->jobsets ]
|
||||
);
|
||||
|
||||
my %decl = (
|
||||
"declarative" => {
|
||||
"file" => $self->get_column("declfile") // "",
|
||||
"type" => $self->get_column("decltype") // "",
|
||||
"value" => $self->get_column("declvalue") // ""
|
||||
}
|
||||
);
|
||||
|
||||
%json = (%json, %decl) if !($decl{"declarative"}->{"file"} eq "");
|
||||
|
||||
return \%json;
|
||||
}
|
||||
|
||||
1;
|
53
src/lib/Hydra/Schema/Result/SchemaVersion.pm
Normal file
53
src/lib/Hydra/Schema/Result/SchemaVersion.pm
Normal file
@ -0,0 +1,53 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::SchemaVersion;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::SchemaVersion
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<schemaversion>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("schemaversion");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 version
|
||||
|
||||
data_type: 'integer'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns("version", { data_type => "integer", is_nullable => 0 });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GAlywxH9wpqRoD36GobQvA
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
1;
|
145
src/lib/Hydra/Schema/Result/StarredJobs.pm
Normal file
145
src/lib/Hydra/Schema/Result/StarredJobs.pm
Normal file
@ -0,0 +1,145 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::StarredJobs;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::StarredJobs
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<starredjobs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("starredjobs");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 username
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 project
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 jobset
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 job
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"username",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"project",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"jobset",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"job",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</username>
|
||||
|
||||
=item * L</project>
|
||||
|
||||
=item * L</jobset>
|
||||
|
||||
=item * L</job>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("username", "project", "jobset", "job");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 jobset
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Jobsets>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"jobset",
|
||||
"Hydra::Schema::Result::Jobsets",
|
||||
{ name => "jobset", project => "project" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
=head2 project
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Projects>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"project",
|
||||
"Hydra::Schema::Result::Projects",
|
||||
{ name => "project" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
=head2 username
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Users>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"username",
|
||||
"Hydra::Schema::Result::Users",
|
||||
{ username => "username" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:j+dXc22FIqlCSmP3mOX+Aw
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
1;
|
75
src/lib/Hydra/Schema/Result/SystemStatus.pm
Normal file
75
src/lib/Hydra/Schema/Result/SystemStatus.pm
Normal file
@ -0,0 +1,75 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::SystemStatus;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::SystemStatus
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<systemstatus>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("systemstatus");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 what
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 status
|
||||
|
||||
data_type: 'json'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"what",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"status",
|
||||
{ data_type => "json", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</what>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("what");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ps8gKPEnK1tTa/hXYz+27A
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
1;
|
74
src/lib/Hydra/Schema/Result/SystemTypes.pm
Normal file
74
src/lib/Hydra/Schema/Result/SystemTypes.pm
Normal file
@ -0,0 +1,74 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::SystemTypes;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::SystemTypes
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<systemtypes>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("systemtypes");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 system
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 maxconcurrent
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 2
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"system",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"maxconcurrent",
|
||||
{ data_type => "integer", default_value => 2, is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</system>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("system");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:skzz9Wqwox5QO35YSgVXbw
|
||||
|
||||
1;
|
75
src/lib/Hydra/Schema/Result/UriRevMapper.pm
Normal file
75
src/lib/Hydra/Schema/Result/UriRevMapper.pm
Normal file
@ -0,0 +1,75 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::UriRevMapper;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::UriRevMapper
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<urirevmapper>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("urirevmapper");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 baseuri
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 uri
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"baseuri",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"uri",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</baseuri>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("baseuri");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:prycgyKZhOx4ch18xkoj1w
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
1;
|
93
src/lib/Hydra/Schema/Result/UserRoles.pm
Normal file
93
src/lib/Hydra/Schema/Result/UserRoles.pm
Normal file
@ -0,0 +1,93 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::UserRoles;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::UserRoles
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<userroles>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("userroles");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 username
|
||||
|
||||
data_type: 'text'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 role
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"username",
|
||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||
"role",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</username>
|
||||
|
||||
=item * L</role>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("username", "role");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 username
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Users>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"username",
|
||||
"Hydra::Schema::Result::Users",
|
||||
{ username => "username" },
|
||||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MZCKml/f7xn3GmsqocCuuQ
|
||||
|
||||
1;
|
272
src/lib/Hydra/Schema/Result/Users.pm
Normal file
272
src/lib/Hydra/Schema/Result/Users.pm
Normal file
@ -0,0 +1,272 @@
|
||||
use utf8;
|
||||
package Hydra::Schema::Result::Users;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Hydra::Schema::Result::Users
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 COMPONENTS LOADED
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L<Hydra::Component::ToJSON>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->load_components("+Hydra::Component::ToJSON");
|
||||
|
||||
=head1 TABLE: C<users>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("users");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 username
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 fullname
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
|
||||
=head2 emailaddress
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 password
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 emailonerror
|
||||
|
||||
data_type: 'integer'
|
||||
default_value: 0
|
||||
is_nullable: 0
|
||||
|
||||
=head2 type
|
||||
|
||||
data_type: 'text'
|
||||
default_value: 'hydra'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 publicdashboard
|
||||
|
||||
data_type: 'boolean'
|
||||
default_value: false
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"username",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"fullname",
|
||||
{ data_type => "text", is_nullable => 1 },
|
||||
"emailaddress",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"password",
|
||||
{ data_type => "text", is_nullable => 0 },
|
||||
"emailonerror",
|
||||
{ data_type => "integer", default_value => 0, is_nullable => 0 },
|
||||
"type",
|
||||
{ data_type => "text", default_value => "hydra", is_nullable => 0 },
|
||||
"publicdashboard",
|
||||
{ data_type => "boolean", default_value => \"false", is_nullable => 0 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</username>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("username");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 newsitems
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::NewsItems>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"newsitems",
|
||||
"Hydra::Schema::Result::NewsItems",
|
||||
{ "foreign.author" => "self.username" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 projectmembers
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::ProjectMembers>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"projectmembers",
|
||||
"Hydra::Schema::Result::ProjectMembers",
|
||||
{ "foreign.username" => "self.username" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 projects_2s
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::Projects>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"projects_2s",
|
||||
"Hydra::Schema::Result::Projects",
|
||||
{ "foreign.owner" => "self.username" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 starredjobs
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::StarredJobs>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"starredjobs",
|
||||
"Hydra::Schema::Result::StarredJobs",
|
||||
{ "foreign.username" => "self.username" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 userroles
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Hydra::Schema::Result::UserRoles>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"userroles",
|
||||
"Hydra::Schema::Result::UserRoles",
|
||||
{ "foreign.username" => "self.username" },
|
||||
undef,
|
||||
);
|
||||
|
||||
=head2 projects
|
||||
|
||||
Type: many_to_many
|
||||
|
||||
Composing rels: L</projectmembers> -> project
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->many_to_many("projects", "projectmembers", "project");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qePTzHYl/TjCSjZrU2g/cg
|
||||
|
||||
use Crypt::Passphrase;
|
||||
use Digest::SHA1 qw(sha1_hex);
|
||||
use String::Compare::ConstantTime;
|
||||
|
||||
my %hint = (
|
||||
columns => [
|
||||
"fullname",
|
||||
"emailaddress",
|
||||
"username"
|
||||
],
|
||||
relations => {
|
||||
userroles => "role"
|
||||
}
|
||||
);
|
||||
|
||||
sub json_hint {
|
||||
return \%hint;
|
||||
}
|
||||
|
||||
sub _authenticator() {
|
||||
my $authenticator = Crypt::Passphrase->new(
|
||||
encoder => 'Argon2',
|
||||
validators => [
|
||||
(sub {
|
||||
my ($password, $hash) = @_;
|
||||
|
||||
return String::Compare::ConstantTime::equals($hash, sha1_hex($password));
|
||||
})
|
||||
],
|
||||
);
|
||||
|
||||
return $authenticator;
|
||||
}
|
||||
|
||||
sub check_password {
|
||||
my ($self, $password) = @_;
|
||||
|
||||
my $authenticator = _authenticator();
|
||||
if ($authenticator->verify_password($password, $self->password)) {
|
||||
if ($authenticator->needs_rehash($self->password)) {
|
||||
$self->setPassword($password);
|
||||
}
|
||||
|
||||
return 1;
|
||||
} elsif ($authenticator->verify_password(sha1_hex($password), $self->password)) {
|
||||
# The user's database record has their old password as sha1, re-hashed as Argon2.
|
||||
# Store their password hashed only with Argon2.
|
||||
$self->setPassword($password);
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub setPassword {
|
||||
my ($self, $password) = @_;;
|
||||
|
||||
$self->update({
|
||||
"password" => _authenticator()->hash_password($password),
|
||||
});
|
||||
}
|
||||
|
||||
sub setPasswordHash {
|
||||
my ($self, $passwordHash) = @_;;
|
||||
|
||||
if ($passwordHash =~ /^[a-f0-9]{40}$/) {
|
||||
# This is (probably) a sha1 password, re-hash it and we'll check for a hashed sha1 in Users.pm
|
||||
$self->setPassword($passwordHash);
|
||||
} else {
|
||||
$self->update({ password => $passwordHash });
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
Reference in New Issue
Block a user