From bc1ffc5214ab3f563b60523d9c349fab7974e634 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 18 Feb 2018 11:23:41 +0000 Subject: Add some govuk-guix related jobs And various other views and routes. --- db/migrate/20180216231420_create_govuk_guix_revisions.rb | 11 +++++++++++ .../20180217104954_change_govuk_guix_revisions_column_name.rb | 5 +++++ .../20180217105604_change_govuk_guix_revisions_primary_key.rb | 7 +++++++ ...80217110041_add_govuk_guix_revision_to_mini_environment.rb | 5 +++++ .../20180217131053_add_start_command_to_mini_environment.rb | 5 +++++ 5 files changed, 33 insertions(+) create mode 100644 db/migrate/20180216231420_create_govuk_guix_revisions.rb create mode 100644 db/migrate/20180217104954_change_govuk_guix_revisions_column_name.rb create mode 100644 db/migrate/20180217105604_change_govuk_guix_revisions_primary_key.rb create mode 100644 db/migrate/20180217110041_add_govuk_guix_revision_to_mini_environment.rb create mode 100644 db/migrate/20180217131053_add_start_command_to_mini_environment.rb (limited to 'db/migrate') diff --git a/db/migrate/20180216231420_create_govuk_guix_revisions.rb b/db/migrate/20180216231420_create_govuk_guix_revisions.rb new file mode 100644 index 0000000..0572119 --- /dev/null +++ b/db/migrate/20180216231420_create_govuk_guix_revisions.rb @@ -0,0 +1,11 @@ +class CreateGovukGuixRevisions < ActiveRecord::Migration[5.1] + def change + create_table :govuk_guix_revisions do |t| + t.string :treeish + t.string :store_path + + t.timestamps + end + add_index :govuk_guix_revisions, :treeish, unique: true + end +end diff --git a/db/migrate/20180217104954_change_govuk_guix_revisions_column_name.rb b/db/migrate/20180217104954_change_govuk_guix_revisions_column_name.rb new file mode 100644 index 0000000..cf57216 --- /dev/null +++ b/db/migrate/20180217104954_change_govuk_guix_revisions_column_name.rb @@ -0,0 +1,5 @@ +class ChangeGovukGuixRevisionsColumnName < ActiveRecord::Migration[5.1] + def change + rename_column :govuk_guix_revisions, :treeish, :commit_hash + end +end diff --git a/db/migrate/20180217105604_change_govuk_guix_revisions_primary_key.rb b/db/migrate/20180217105604_change_govuk_guix_revisions_primary_key.rb new file mode 100644 index 0000000..5b582ad --- /dev/null +++ b/db/migrate/20180217105604_change_govuk_guix_revisions_primary_key.rb @@ -0,0 +1,7 @@ +class ChangeGovukGuixRevisionsPrimaryKey < ActiveRecord::Migration[5.1] + def change + execute 'ALTER TABLE govuk_guix_revisions DROP CONSTRAINT govuk_guix_revisions_pkey;' + execute 'ALTER TABLE govuk_guix_revisions ADD PRIMARY KEY (commit_hash);' + remove_column :govuk_guix_revisions, :id + end +end diff --git a/db/migrate/20180217110041_add_govuk_guix_revision_to_mini_environment.rb b/db/migrate/20180217110041_add_govuk_guix_revision_to_mini_environment.rb new file mode 100644 index 0000000..56d5883 --- /dev/null +++ b/db/migrate/20180217110041_add_govuk_guix_revision_to_mini_environment.rb @@ -0,0 +1,5 @@ +class AddGovukGuixRevisionToMiniEnvironment < ActiveRecord::Migration[5.1] + def change + add_reference :mini_environments, :govuk_guix_revision, type: :string, foreign_key: { primary_key: :commit_hash } + end +end diff --git a/db/migrate/20180217131053_add_start_command_to_mini_environment.rb b/db/migrate/20180217131053_add_start_command_to_mini_environment.rb new file mode 100644 index 0000000..05d8704 --- /dev/null +++ b/db/migrate/20180217131053_add_start_command_to_mini_environment.rb @@ -0,0 +1,5 @@ +class AddStartCommandToMiniEnvironment < ActiveRecord::Migration[5.1] + def change + add_column :mini_environments, :start_command, :string + end +end -- cgit v1.2.3