Jobs: add a nullable jobset_id foreign key to Jobsets.

[?]
Feb 5, 2020, 10:10 PM
SIDK2E7VTH36ETTT7VQWKUXIJE3GQCH4EA33TJG3S4ZTOPTKYCNAC

Dependencies

  • [2] FZR7ET5D Jobsets: add a SERIAL, unique, non-null id column
  • [3] CCIORPJ5 When manually scheduling an eval, force re-instantiation of store derivations
  • [4] MWXDVTS3 Copy the flake migration from the flake branch
  • [5] KQAQ4FIF Update Schema classes
  • [6] X27GNHDV * Basic job info in the database.
  • [7] SB2V735V Keep track of the database schema version
  • [8] PCKLFRT5 Support push notification of repository changes
  • [9] IGR322YP sql: Generate models from postgresql
  • [10] FYO6NECE hydra
  • [11] JM3DPYOM generated schema with new dbix class schema loader, grrrrrr
  • [12] QLOLZHRX Allow a per-jobset check interval
  • [13] DH3KNBAV Merge remote-tracking branch 'upstream/who-broke-builds' into upstream-master
  • [14] K3HODXGH Check all inputs for blame but only email selected inputs
  • [15] T5BIOVJE Add support for tracking custom metrics
  • [16] W4G5MZZS hydra-evaluator improvements
  • [17] PCD3ZH6Z Partially revert 1c20cfdf2403feb78cef515faf15c04d5c9f17bd
  • [18] S5PV6IIM * Represent jobs explicitly in the DB.
  • [19] Y6AHH4TH Remove the logfile and logSize columns from the database
  • [20] GEADFVZ5 hydra-queue-runner: Improved scheduling
  • [21] KSBB33RE Add a dashboard
  • [22] SS4TZXNU Distinguish between permanent evaluation errors and transient input errors
  • [23] LZVO64YG Merge in the first bits of the API work
  • [24] W5OAZWPD Drop the errorMsg column in the Jobs table
  • [*] KN3VYE5P * Cleaned up the foreign key constraints.
  • [*] N22GPKYT * Put info about logs / build products in the DB.
  • [*] D5QIOJGP * Move everything up one directory.

Change contents

  • edit in src/lib/Hydra/Schema/Jobs.pm at line 49
    [3.13837]
    [3.13851]
    =head2 jobset_id
    data_type: 'integer'
    is_foreign_key: 1
    is_nullable: 1
  • edit in src/lib/Hydra/Schema/Jobs.pm at line 68
    [3.15510]
    [3.1774]
    "jobset_id",
    { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
  • edit in src/lib/Hydra/Schema/Jobs.pm at line 140
    [26.1352]
    [26.1352]
    "Hydra::Schema::Jobsets",
    { id => "jobset_id" },
    {
    is_deferrable => 0,
    join_type => "LEFT",
    on_delete => "CASCADE",
    on_update => "NO ACTION",
    },
    );
    =head2 jobset_project_jobset
    Type: belongs_to
    Related object: L<Hydra::Schema::Jobsets>
    =cut
    __PACKAGE__->belongs_to(
    "jobset_project_jobset",
  • replacement in src/lib/Hydra/Schema/Jobs.pm at line 200
    [3.1556][3.3858:4000]()
    # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-06 12:22:36
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sYa6dZNK+stMAnTH0Tmn8A
    [3.1556]
    [3.2756]
    # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-06 12:30:58
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dFusVjxb423gIEoadAw9sw
  • edit in src/lib/Hydra/Schema/Jobsets.pm at line 277
    [3.2717]
    [3.19391]
    =head2 jobs_jobset_ids
    Type: has_many
  • replacement in src/lib/Hydra/Schema/Jobsets.pm at line 282
    [3.19392][3.19392:19404]()
    =head2 jobs
    [3.19392]
    [3.19404]
    Related object: L<Hydra::Schema::Jobs>
    =cut
    __PACKAGE__->has_many(
    "jobs_jobset_ids",
    "Hydra::Schema::Jobs",
    { "foreign.jobset_id" => "self.id" },
    undef,
    );
    =head2 jobs_project_jobsets
  • replacement in src/lib/Hydra/Schema/Jobsets.pm at line 302
    [3.2740][3.2740:2750]()
    "jobs",
    [3.2740]
    [3.2750]
    "jobs_project_jobsets",
  • replacement in src/lib/Hydra/Schema/Jobsets.pm at line 396
    [3.22628][2.420:562]()
    # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-09 15:25:17
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1CMOaLf9fYRdJBlYiivmxA
    [3.22628]
    [2.562]
    # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-09 15:26:15
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DH1jX0smo2rFvyr4V+qJcw
    =head2 jobs
    Type: has_many
    Related object: L<Hydra::Schema::Jobs>
    =cut
    __PACKAGE__->has_many(
    "jobs",
    "Hydra::Schema::Jobs",
    {
    "foreign.jobset" => "self.name",
    "foreign.project" => "self.project",
    },
    undef,
    );
  • edit in src/sql/hydra.sql at line 149
    [26.6902]
    [26.6902]
    jobset_id integer null,
  • edit in src/sql/hydra.sql at line 153
    [26.7316]
    [26.7316]
    foreign key (jobset_id) references Jobsets(id) on delete cascade,
  • file addition: upgrade-60.sql (----------)
    [28.3004]
    -- Add the jobset_id columns to the Jobs table. This will go
    -- quickly, since the field is nullable. Note this is just part one of
    -- this migration. Future steps involve a piecemeal backfilling, and
    -- then making the column non-null.
    ALTER TABLE Jobs
    ADD COLUMN jobset_id integer NULL,
    ADD FOREIGN KEY (jobset_id)
    REFERENCES Jobsets(id)
    ON DELETE CASCADE;