From fec08462eeaf30f45c6cc6abf00069ce9cd0059f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 12 Mar 2009 13:42:44 +0000 Subject: [PATCH] * In Sqlite "release" is now a keyword, so use "release_" instead. Note: to upgrade old databases, do a dump with an old Sqlite first; dumping with a new Sqlite will silently discard (!) the contents of the ReleaseSetJobs table. --- src/lib/Hydra/Schema.pm | 4 ++-- src/lib/Hydra/Schema/BuildInputs.pm | 4 ++-- src/lib/Hydra/Schema/BuildProducts.pm | 4 ++-- src/lib/Hydra/Schema/BuildResultInfo.pm | 4 ++-- src/lib/Hydra/Schema/BuildSchedulingInfo.pm | 4 ++-- src/lib/Hydra/Schema/BuildSteps.pm | 4 ++-- src/lib/Hydra/Schema/Builds.pm | 4 ++-- src/lib/Hydra/Schema/CachedPathInputs.pm | 4 ++-- src/lib/Hydra/Schema/CachedSubversionInputs.pm | 4 ++-- src/lib/Hydra/Schema/JobsetInputAlts.pm | 4 ++-- src/lib/Hydra/Schema/JobsetInputs.pm | 4 ++-- src/lib/Hydra/Schema/Jobsets.pm | 4 ++-- src/lib/Hydra/Schema/Projects.pm | 4 ++-- src/lib/Hydra/Schema/ReleaseSetJobs.pm | 10 +++++----- src/lib/Hydra/Schema/ReleaseSets.pm | 8 ++++---- src/lib/Hydra/Schema/SystemTypes.pm | 4 ++-- src/lib/Hydra/Schema/UserRoles.pm | 4 ++-- src/lib/Hydra/Schema/Users.pm | 4 ++-- src/sql/hydra.sql | 14 ++++++++------ 19 files changed, 49 insertions(+), 47 deletions(-) diff --git a/src/lib/Hydra/Schema.pm b/src/lib/Hydra/Schema.pm index 42340a27..226ded24 100644 --- a/src/lib/Hydra/Schema.pm +++ b/src/lib/Hydra/Schema.pm @@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema'; __PACKAGE__->load_classes; -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DQAmauNODAxmM2mF/AE2aQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bK7m5SJjCnJKOckiufcb9w # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/BuildInputs.pm b/src/lib/Hydra/Schema/BuildInputs.pm index 0548fb8d..dd4a59ad 100644 --- a/src/lib/Hydra/Schema/BuildInputs.pm +++ b/src/lib/Hydra/Schema/BuildInputs.pm @@ -36,8 +36,8 @@ __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); __PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:L6NP/+9zhMg4TRw3w911rg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:11XN47b5bRrRKiWtzLO+Pw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/BuildProducts.pm b/src/lib/Hydra/Schema/BuildProducts.pm index e51fe9d5..ff5ea0c4 100644 --- a/src/lib/Hydra/Schema/BuildProducts.pm +++ b/src/lib/Hydra/Schema/BuildProducts.pm @@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("build", "productnr"); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yTJRsclWIpHApRSLqyR06Q +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gUnxXuaqq40KFRIUSBmVuA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/BuildResultInfo.pm b/src/lib/Hydra/Schema/BuildResultInfo.pm index 8c740d96..3e4e240f 100644 --- a/src/lib/Hydra/Schema/BuildResultInfo.pm +++ b/src/lib/Hydra/Schema/BuildResultInfo.pm @@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:o1XAUgKd15pN76Rs8aX+IA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xvSDu+FkyKp5wTAEGmiKOw __PACKAGE__->belongs_to( "failedDep", diff --git a/src/lib/Hydra/Schema/BuildSchedulingInfo.pm b/src/lib/Hydra/Schema/BuildSchedulingInfo.pm index fb8ca20e..851c6144 100644 --- a/src/lib/Hydra/Schema/BuildSchedulingInfo.pm +++ b/src/lib/Hydra/Schema/BuildSchedulingInfo.pm @@ -27,8 +27,8 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MeS9DLCs3kuhS4pTqfl4Lg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xv5P0Erv5oEy4r3c9RuV0w # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/BuildSteps.pm b/src/lib/Hydra/Schema/BuildSteps.pm index 4d927d59..4294d301 100644 --- a/src/lib/Hydra/Schema/BuildSteps.pm +++ b/src/lib/Hydra/Schema/BuildSteps.pm @@ -35,7 +35,7 @@ __PACKAGE__->set_primary_key("id", "stepnr"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nFSksz60oxcM1+nYqAdjzw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ne+uSrfxnk+wK60IrVoTww 1; diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index a3ed1233..ef0a4e38 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -76,8 +76,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:p9SIzdyW9p4+eqwKwXzAdQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iwt05CKHqfd33lW+wAC2mw __PACKAGE__->has_many(dependents => 'Hydra::Schema::BuildInputs', 'dependency'); diff --git a/src/lib/Hydra/Schema/CachedPathInputs.pm b/src/lib/Hydra/Schema/CachedPathInputs.pm index 887d9cfe..5c981d47 100644 --- a/src/lib/Hydra/Schema/CachedPathInputs.pm +++ b/src/lib/Hydra/Schema/CachedPathInputs.pm @@ -22,8 +22,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("srcpath", "sha256hash"); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zvTGb3qhlacSWzc0H+7dfg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Hjklk18AGqKd7dDPUlqS9A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/CachedSubversionInputs.pm b/src/lib/Hydra/Schema/CachedSubversionInputs.pm index 2f4e55c4..7a5095a2 100644 --- a/src/lib/Hydra/Schema/CachedSubversionInputs.pm +++ b/src/lib/Hydra/Schema/CachedSubversionInputs.pm @@ -20,8 +20,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("uri", "revision"); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TY8SHfWiBibwiG3WPkP8Mg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OMt7YCEd4Vc3edHp2fxcrw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/JobsetInputAlts.pm b/src/lib/Hydra/Schema/JobsetInputAlts.pm index 2c7eb411..6755b253 100644 --- a/src/lib/Hydra/Schema/JobsetInputAlts.pm +++ b/src/lib/Hydra/Schema/JobsetInputAlts.pm @@ -31,8 +31,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4iKXGIdrm56xZeHFxa/K4A +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gQOuvSuoR2kczD57yaVSwQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/JobsetInputs.pm b/src/lib/Hydra/Schema/JobsetInputs.pm index 7f4da4e3..1cc0396d 100644 --- a/src/lib/Hydra/Schema/JobsetInputs.pm +++ b/src/lib/Hydra/Schema/JobsetInputs.pm @@ -43,8 +43,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rh03/olFXpMiTA+zhRYltg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GpIp3ENzylBZ9HQUNhO17Q # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/Jobsets.pm b/src/lib/Hydra/Schema/Jobsets.pm index f5c8b8d3..5ed1fb07 100644 --- a/src/lib/Hydra/Schema/Jobsets.pm +++ b/src/lib/Hydra/Schema/Jobsets.pm @@ -50,8 +50,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IfDpZfiD9haRHLXGdkapGg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BcAloJiRDPMvL/+GqsPiTw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/Projects.pm b/src/lib/Hydra/Schema/Projects.pm index 23418ede..025595e5 100644 --- a/src/lib/Hydra/Schema/Projects.pm +++ b/src/lib/Hydra/Schema/Projects.pm @@ -45,8 +45,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7VRmssxrhgzfySJ6OGuhGg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TTHljyVTOMxXzNATXkltNg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/ReleaseSetJobs.pm b/src/lib/Hydra/Schema/ReleaseSetJobs.pm index 113e5c3a..73d7bf51 100644 --- a/src/lib/Hydra/Schema/ReleaseSetJobs.pm +++ b/src/lib/Hydra/Schema/ReleaseSetJobs.pm @@ -10,7 +10,7 @@ __PACKAGE__->table("ReleaseSetJobs"); __PACKAGE__->add_columns( "project", { data_type => "text", is_nullable => 0, size => undef }, - "release", + "release_", { data_type => "text", is_nullable => 0, size => undef }, "job", { data_type => "text", is_nullable => 0, size => undef }, @@ -23,17 +23,17 @@ __PACKAGE__->add_columns( "description", { data_type => "text", is_nullable => 0, size => undef }, ); -__PACKAGE__->set_primary_key("project", "release", "job", "attrs"); +__PACKAGE__->set_primary_key("project", "release_", "job", "attrs"); __PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }); __PACKAGE__->belongs_to( "releaseset", "Hydra::Schema::ReleaseSets", - { name => "release", project => "project" }, + { name => "release_", project => "project" }, ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GdOtS3nLs7dwpArSdGob0w +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YC+cgQcuvO4TxC5UpU7u4A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/ReleaseSets.pm b/src/lib/Hydra/Schema/ReleaseSets.pm index 41daa1a1..b3410e3f 100644 --- a/src/lib/Hydra/Schema/ReleaseSets.pm +++ b/src/lib/Hydra/Schema/ReleaseSets.pm @@ -23,14 +23,14 @@ __PACKAGE__->has_many( "releasesetjobs", "Hydra::Schema::ReleaseSetJobs", { - "foreign.project" => "self.project", - "foreign.release" => "self.name", + "foreign.project" => "self.project", + "foreign.release_" => "self.name", }, ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lQymTkBv/Av2y6iYjvP5PQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Sv+5cdtqHDjWM0Zmmu0PSg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/SystemTypes.pm b/src/lib/Hydra/Schema/SystemTypes.pm index fb1d51e7..e51a3a16 100644 --- a/src/lib/Hydra/Schema/SystemTypes.pm +++ b/src/lib/Hydra/Schema/SystemTypes.pm @@ -16,8 +16,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("system"); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KZzTedcMG8IxkLgEEkdn9A +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RLOKTpEzFYJMyzgMCg7zSg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/UserRoles.pm b/src/lib/Hydra/Schema/UserRoles.pm index 5a827a90..c13480f5 100644 --- a/src/lib/Hydra/Schema/UserRoles.pm +++ b/src/lib/Hydra/Schema/UserRoles.pm @@ -17,8 +17,8 @@ __PACKAGE__->set_primary_key("username", "role"); __PACKAGE__->belongs_to("username", "Hydra::Schema::Users", { username => "username" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9YGxnZD9hLoJJ8b1aejBuA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QTXCy6SeSRYYXW3odCVLiQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/lib/Hydra/Schema/Users.pm b/src/lib/Hydra/Schema/Users.pm index 611db739..cd2c167c 100644 --- a/src/lib/Hydra/Schema/Users.pm +++ b/src/lib/Hydra/Schema/Users.pm @@ -30,8 +30,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-09 18:05:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HwKK4N8V5fzvR3XrKnrDEA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-12 14:17:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eQFOcWRNwb7IE1ifGrw4rQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/sql/hydra.sql b/src/sql/hydra.sql index 306bb3c4..ce8c7747 100644 --- a/src/sql/hydra.sql +++ b/src/sql/hydra.sql @@ -337,21 +337,23 @@ create table ReleaseSets ( create trigger cascadeReleaseSetDelete before delete on ReleaseSets for each row begin - delete from ReleaseSetJobs where project = old.project and release = old.name; + delete from ReleaseSetJobs where project = old.project and release_ = old.name; end; create trigger cascadeReleaseSetUpdate update of name on ReleaseSets for each row begin - update ReleaseSetJobs set release = new.name where project = old.project and release = old.name; + update ReleaseSetJobs set release_ = new.name where project = old.project and release_ = old.name; end; create table ReleaseSetJobs ( project text not null, - -- !!! urgh: "release" is a reserved keyword in sqlite >= 3.6.8! - release text not null, + -- `release' is a reserved keyword in sqlite >= 3.6.8. We could + -- quote them ("release") here, but since the Perl bindings don't + -- do that it still wouldn't work. So use `release_' instead. + release_ text not null, job text not null, @@ -368,7 +370,7 @@ create table ReleaseSetJobs ( description text, - primary key (project, release, job, attrs), + primary key (project, release_, job, attrs), foreign key (project) references Projects(name) on delete cascade, -- ignored by sqlite - foreign key (project, release) references ReleaseSets(project, name) on delete cascade -- ignored by sqlite + foreign key (project, release_) references ReleaseSets(project, name) on delete cascade -- ignored by sqlite );