forked from lix-project/hydra
Jobs.jobset_id: make not-null
This commit is contained in:
parent
add4f610ce
commit
2cdcc7f188
3 changed files with 13 additions and 11 deletions
|
@ -51,7 +51,7 @@ __PACKAGE__->table("jobs");
|
||||||
|
|
||||||
data_type: 'integer'
|
data_type: 'integer'
|
||||||
is_foreign_key: 1
|
is_foreign_key: 1
|
||||||
is_nullable: 1
|
is_nullable: 0
|
||||||
|
|
||||||
=head2 name
|
=head2 name
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ __PACKAGE__->add_columns(
|
||||||
"jobset",
|
"jobset",
|
||||||
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
{ data_type => "text", is_foreign_key => 1, is_nullable => 0 },
|
||||||
"jobset_id",
|
"jobset_id",
|
||||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
|
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
|
||||||
"name",
|
"name",
|
||||||
{ data_type => "text", is_nullable => 0 },
|
{ data_type => "text", is_nullable => 0 },
|
||||||
);
|
);
|
||||||
|
@ -139,12 +139,7 @@ __PACKAGE__->belongs_to(
|
||||||
"jobset",
|
"jobset",
|
||||||
"Hydra::Schema::Jobsets",
|
"Hydra::Schema::Jobsets",
|
||||||
{ id => "jobset_id" },
|
{ id => "jobset_id" },
|
||||||
{
|
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
|
||||||
is_deferrable => 0,
|
|
||||||
join_type => "LEFT",
|
|
||||||
on_delete => "CASCADE",
|
|
||||||
on_update => "NO ACTION",
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
=head2 jobset_project_jobset
|
=head2 jobset_project_jobset
|
||||||
|
@ -197,7 +192,7 @@ __PACKAGE__->has_many(
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-06 12:30:58
|
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-06 12:33:28
|
||||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dFusVjxb423gIEoadAw9sw
|
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:C5Tyh8Ke4yC6q7KIFVOHcQ
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -146,7 +146,7 @@ create table JobsetInputAlts (
|
||||||
create table Jobs (
|
create table Jobs (
|
||||||
project text not null,
|
project text not null,
|
||||||
jobset text not null,
|
jobset text not null,
|
||||||
jobset_id integer null,
|
jobset_id integer not null,
|
||||||
name text not null,
|
name text not null,
|
||||||
|
|
||||||
primary key (project, jobset, name),
|
primary key (project, jobset, name),
|
||||||
|
|
7
src/sql/upgrade-63.sql
Normal file
7
src/sql/upgrade-63.sql
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
-- Make the Jobs.jobset_id column NOT NULL. If this upgrade fails,
|
||||||
|
-- either the admin didn't run the backfiller or there is a bug. If
|
||||||
|
-- the admin ran the backfiller and there are null columns, it is
|
||||||
|
-- very important to figure out where the nullable columns came from.
|
||||||
|
|
||||||
|
ALTER TABLE Jobs
|
||||||
|
ALTER COLUMN jobset_id SET NOT NULL;
|
Loading…
Reference in a new issue