Class: SetupActiveRecordRollout

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/templates/migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/templates/migration.rb', line 2

def change
  create_table :active_record_rollout_features do |t|
    t.string :name
    t.integer :failure_count, default: 0
    t.timestamps
  end

  add_index :active_record_rollout_features, :name, unique: true

  create_table :active_record_rollout_flags do |t|
    t.string  :type
    t.integer :feature_id
    t.integer :flaggable_id
    t.string  :flaggable_type
    t.string  :group_name
    t.integer :percentage
    t.timestamps
  end

  add_index :active_record_rollout_flags, :type
  add_index :active_record_rollout_flags, :feature_id
end