summaryrefslogtreecommitdiff
path: root/db/migrate/20170620064728_create_ci_pipeline_schedule_variables.rb
blob: 92833765a827457bf36f9648f5a385bc96e6f243 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class CreateCiPipelineScheduleVariables < ActiveRecord::Migration
  DOWNTIME = false

  def up
    create_table :ci_pipeline_schedule_variables do |t|
      t.string :key, null: false
      t.text :value
      t.text :encrypted_value
      t.string :encrypted_value_salt
      t.string :encrypted_value_iv
      t.integer :pipeline_schedule_id, null: false

      t.timestamps_with_timezone null: true
    end

    add_index :ci_pipeline_schedule_variables,
      [:pipeline_schedule_id, :key],
      name: "index_ci_pipeline_schedule_variables_on_schedule_id_and_key",
      unique: true
  end

  def down
    drop_table :ci_pipeline_schedule_variables
  end
end