aboutsummaryrefslogtreecommitdiff
path: root/db/migrate/20180530192706_add_govuk_guix_revision_to_govuk_guix_data_snapshot.rb
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-05-30 20:36:03 +0100
committerChristopher Baines <mail@cbaines.net>2018-06-01 18:23:11 +0100
commite043d884e9dc077f1ab366d956ee7dd9df4c7460 (patch)
tree8679f60e84b1e690f5b44bc8c7cdea040a3127c7 /db/migrate/20180530192706_add_govuk_guix_revision_to_govuk_guix_data_snapshot.rb
parent8b1ae33144bc4d496980ffc16cd304c8f107aff4 (diff)
downloadgovuk-mini-environment-admin-e043d884e9dc077f1ab366d956ee7dd9df4c7460.tar
govuk-mini-environment-admin-e043d884e9dc077f1ab366d956ee7dd9df4c7460.tar.gz
Add the GovukGuix::Revision commit_hash to the DataSnapshot model
This is to record the revision of govuk-guix used to create the snapshot.
Diffstat (limited to 'db/migrate/20180530192706_add_govuk_guix_revision_to_govuk_guix_data_snapshot.rb')
-rw-r--r--db/migrate/20180530192706_add_govuk_guix_revision_to_govuk_guix_data_snapshot.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20180530192706_add_govuk_guix_revision_to_govuk_guix_data_snapshot.rb b/db/migrate/20180530192706_add_govuk_guix_revision_to_govuk_guix_data_snapshot.rb
new file mode 100644
index 0000000..5a735dc
--- /dev/null
+++ b/db/migrate/20180530192706_add_govuk_guix_revision_to_govuk_guix_data_snapshot.rb
@@ -0,0 +1,16 @@
+class AddGovukGuixRevisionToGovukGuixDataSnapshot < ActiveRecord::Migration[5.1]
+ def change
+ add_column(
+ :govuk_guix_data_snapshots,
+ :govuk_guix_revision_commit_hash,
+ :string,
+ null: false
+ )
+ add_foreign_key(
+ :govuk_guix_data_snapshots,
+ :govuk_guix_revisions,
+ column: :govuk_guix_revision_commit_hash,
+ primary_key: :commit_hash
+ )
+ end
+end