summaryrefslogtreecommitdiff
path: root/db/migrate/20170525130346_create_group_variables_table.rb
blob: eaa38dbc40d466a3a136e9cd8f116d9238bb54b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class CreateGroupVariablesTable < ActiveRecord::Migration
  DOWNTIME = false

  def up
    create_table :ci_group_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 :group_id, null: false
      t.boolean :protected, default: false, null: false

      t.timestamps_with_timezone null: false
    end

    add_index :ci_group_variables, [:group_id, :key], unique: true
  end

  def down
    drop_table :ci_group_variables
  end
end