Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2019-07-29 10:43:10 +0300
committerPhil Hughes <me@iamphill.com>2019-07-29 10:43:10 +0300
commita5aa40c5fe93dc3daba8a578f4c09c4e443fcbec (patch)
tree34eb74d209b1919f78ce70d89ee0900cd2602780 /db/migrate
parent946f7c0687760ec49aca582a329d0ec3c7ac3037 (diff)
Add Job specific variables
Adds Job specific variables to facilitate specifying variables when running manual jobs.
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20190711124721_create_job_variables.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/db/migrate/20190711124721_create_job_variables.rb b/db/migrate/20190711124721_create_job_variables.rb
new file mode 100644
index 00000000000..a860522f39e
--- /dev/null
+++ b/db/migrate/20190711124721_create_job_variables.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class CreateJobVariables < ActiveRecord::Migration[5.1]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ create_table :ci_job_variables do |t|
+ t.string :key, null: false
+ t.text :encrypted_value
+ t.string :encrypted_value_iv
+ t.references :job, null: false, index: true, foreign_key: { to_table: :ci_builds, on_delete: :cascade }
+ t.integer :variable_type, null: false, limit: 2, default: 1
+ end
+
+ add_index :ci_job_variables, [:key, :job_id], unique: true
+ end
+end