* Regenerate the bindings from a clean sqlite database.

This commit is contained in:
Eelco Dolstra 2008-11-28 18:02:08 +00:00
parent ff9987c904
commit 5613448a81
20 changed files with 54 additions and 45 deletions

View file

@ -310,7 +310,7 @@ sub releases :Local {
return requireLogin($c) if !$c->user_exists; return requireLogin($c) if !$c->user_exists;
return error($c, "Only the project owner or the administrator can perform this operation.") return error($c, "Only the project owner or the administrator can perform this operation.")
unless $c->check_user_roles('admin') || $c->user->username eq $project->owner; unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username;
if ($subcommand eq "edit") { if ($subcommand eq "edit") {
$c->stash->{template} = 'edit-releaseset.tt'; $c->stash->{template} = 'edit-releaseset.tt';
@ -359,7 +359,7 @@ sub create_releaseset :Local {
return requireLogin($c) if !$c->user_exists; return requireLogin($c) if !$c->user_exists;
return error($c, "Only the project owner or the administrator can perform this operation.") return error($c, "Only the project owner or the administrator can perform this operation.")
unless $c->check_user_roles('admin') || $c->user->username eq $project->owner; unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username;
if (defined $subcommand && $subcommand eq "submit") { if (defined $subcommand && $subcommand eq "submit") {
eval { eval {
@ -552,7 +552,7 @@ sub project :Local {
return requireLogin($c) if !$c->user_exists; return requireLogin($c) if !$c->user_exists;
return error($c, "Only the project owner or the administrator can perform this operation.") return error($c, "Only the project owner or the administrator can perform this operation.")
unless $c->check_user_roles('admin') || $c->user->username eq $project->owner; unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username;
if ($subcommand eq "edit") { if ($subcommand eq "edit") {
$c->stash->{edit} = 1; $c->stash->{edit} = 1;
@ -594,12 +594,13 @@ sub createproject :Local {
if (defined $subcommand && $subcommand eq "submit") { if (defined $subcommand && $subcommand eq "submit") {
eval { eval {
my $projectName = $c->request->params->{name}; my $projectName = trim $c->request->params->{name};
$c->model('DB')->schema->txn_do(sub { $c->model('DB')->schema->txn_do(sub {
# Note: $projectName is validated in updateProject, # Note: $projectName is validated in updateProject,
# which will abort the transaction if the name isn't # which will abort the transaction if the name isn't
# valid. # valid. Idem for the owner.
my $project = $c->model('DB::Projects')->create({name => $projectName, displayname => ""}); my $project = $c->model('DB::Projects')->create(
{name => $projectName, displayname => "", owner => trim $c->request->params->{owner}});
updateProject($c, $project); updateProject($c, $project);
}); });
return $c->res->redirect($c->uri_for("/project", $projectName)); return $c->res->redirect($c->uri_for("/project", $projectName));

View file

@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema';
__PACKAGE__->load_classes; __PACKAGE__->load_classes;
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jJnmW70e1RDsSt5ClahomQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RmC02q4hhhk/Vs/2O97L5w
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -36,8 +36,8 @@ __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
__PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" }); __PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:R1F2JbVygktvK55xmY8mcg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ysEtYtg8L5z3W6dyFzXy9A
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -33,8 +33,8 @@ __PACKAGE__->set_primary_key("build", "productnr");
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aZuZd+oUAO1c8GvSbgn7Fw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/OlaD8I5rojLRBbAL+C/qw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -24,13 +24,15 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"releasename", "releasename",
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"keep",
{ data_type => "integer", is_nullable => 0, size => undef },
); );
__PACKAGE__->set_primary_key("id"); __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QahlwGdZKC7mL7fvwNxWjA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cl2tJxeh476i1qzp28BB4g
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -70,8 +70,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uRSa4YkaRG0K6vK/qhGI9w # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UX6GChi62wrJdc3eYRtCyQ
__PACKAGE__->has_many(dependents => 'Hydra::Schema::Buildinputs', 'dependency'); __PACKAGE__->has_many(dependents => 'Hydra::Schema::Buildinputs', 'dependency');

View file

@ -18,6 +18,8 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"logfile", "logfile",
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"disabled",
{ data_type => "integer", is_nullable => 0, size => undef },
"starttime", "starttime",
{ data_type => "integer", is_nullable => 0, size => undef }, { data_type => "integer", is_nullable => 0, size => undef },
); );
@ -25,8 +27,8 @@ __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xBocoeipFdRsWDhvtoXImA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M45MbodAbVDwSiQDsw3erA
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("id", "stepnr");
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:04BankpQ6xo6T/ioMTdWkQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZAv//9TF7lfoaKCDdCLFNw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -22,8 +22,8 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("srcpath", "sha256hash"); __PACKAGE__->set_primary_key("srcpath", "sha256hash");
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Nq3TpcRmpSRWNL4Q1hGGrA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FJxFwR19zFl2zEcAchDCLg
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -20,8 +20,8 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("uri", "revision"); __PACKAGE__->set_primary_key("uri", "revision");
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CCbHomM+8BTBqHBeGOGcuA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dOpp84bWlqOwiHPe8bsZhQ
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -22,8 +22,6 @@ __PACKAGE__->add_columns(
{ data_type => "integer", is_nullable => 0, size => undef }, { data_type => "integer", is_nullable => 0, size => undef },
"tag", "tag",
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"boolean",
{ data_type => "integer", is_nullable => 0, size => undef },
); );
__PACKAGE__->set_primary_key("project", "jobset", "input", "altnr"); __PACKAGE__->set_primary_key("project", "jobset", "input", "altnr");
__PACKAGE__->belongs_to( __PACKAGE__->belongs_to(
@ -33,8 +31,8 @@ __PACKAGE__->belongs_to(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JPf4ozBKK6NQPJT2few40g # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SXp0Jc4rBeGfm2RajVLJmw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -43,8 +43,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:S8z1W0kjUX9VN5HPjyGAzA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:miVk9N1PJ3HxZVBlMVgxFA
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -50,8 +50,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ebblUCTW7I1wGhVlPfNd3Q # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QTfecLOgMWmoaFLt5Yh2Uw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -25,6 +25,7 @@ __PACKAGE__->has_many(
"Hydra::Schema::Builds", "Hydra::Schema::Builds",
{ "foreign.project" => "self.name" }, { "foreign.project" => "self.name" },
); );
__PACKAGE__->belongs_to("owner", "Hydra::Schema::Users", { username => "owner" });
__PACKAGE__->has_many( __PACKAGE__->has_many(
"jobsets", "jobsets",
"Hydra::Schema::Jobsets", "Hydra::Schema::Jobsets",
@ -42,8 +43,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:70/Br6966ZZ+p8n6lF1hcw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:I8vNdExrfd/eGfHeZRQ21A
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -32,8 +32,8 @@ __PACKAGE__->belongs_to(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:t2ZI1kBn/GsKlY0e4+Wspg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:m3ADAo2XKQ1Mu5JdNa3FFw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -29,8 +29,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pNqwNlXuENM/SsZ/utKhWw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2SXTc8MC9KG9VM0uRHUwig
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -16,8 +16,8 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("system"); __PACKAGE__->set_primary_key("system");
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WeoKp84cptljEdtD+5l7Ug # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AyTEOJr+JjRxJpI1ITG1Tw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -17,8 +17,8 @@ __PACKAGE__->set_primary_key("username", "role");
__PACKAGE__->belongs_to("username", "Hydra::Schema::Users", { username => "username" }); __PACKAGE__->belongs_to("username", "Hydra::Schema::Users", { username => "username" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WxjgPLWPvXpQ3nmxmlU7Dw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5dAhmCyy7/B75rfHAhvNLw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -18,6 +18,11 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
); );
__PACKAGE__->set_primary_key("username"); __PACKAGE__->set_primary_key("username");
__PACKAGE__->has_many(
"projects",
"Hydra::Schema::Projects",
{ "foreign.owner" => "self.username" },
);
__PACKAGE__->has_many( __PACKAGE__->has_many(
"userroles", "userroles",
"Hydra::Schema::Userroles", "Hydra::Schema::Userroles",
@ -25,8 +30,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:s+M14nuDVIMoRSgXodj3dw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xAAXMAwZYAD5ICFz1dEpKQ
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -169,7 +169,7 @@
</tr> </tr>
<tr> <tr>
<th>Owner:</th> <th>Owner:</th>
<td><tt>[% INCLUDE maybeEditString param="owner" value=curProject.owner edit=(edit && c.check_user_roles('admin')) %]</tt></td> <td><tt>[% INCLUDE maybeEditString param="owner" value=curProject.owner.username edit=(edit && c.check_user_roles('admin')) %]</tt></td>
</tr> </tr>
<tr> <tr>
<th>Enabled:</th> <th>Enabled:</th>