aboutsummaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-02-18 11:23:41 +0000
committerChristopher Baines <mail@cbaines.net>2018-03-29 07:41:09 +0100
commitbc1ffc5214ab3f563b60523d9c349fab7974e634 (patch)
tree1caa1ed8bf2fb96c4d340aeffd53cd50a8799980 /db/migrate
parent700b8b0a112fa976b9850418a7f0c71d95b6dd79 (diff)
downloadgovuk-mini-environment-admin-bc1ffc5214ab3f563b60523d9c349fab7974e634.tar
govuk-mini-environment-admin-bc1ffc5214ab3f563b60523d9c349fab7974e634.tar.gz
Add some govuk-guix related jobs
And various other views and routes.
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20180216231420_create_govuk_guix_revisions.rb11
-rw-r--r--db/migrate/20180217104954_change_govuk_guix_revisions_column_name.rb5
-rw-r--r--db/migrate/20180217105604_change_govuk_guix_revisions_primary_key.rb7
-rw-r--r--db/migrate/20180217110041_add_govuk_guix_revision_to_mini_environment.rb5
-rw-r--r--db/migrate/20180217131053_add_start_command_to_mini_environment.rb5
5 files changed, 33 insertions, 0 deletions
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