Sha256: 6cefa6a9021a9c0eac0cca695ca7d6c9453198e335296f29515e0008fa0646af

Contents?: true

Size: 821 Bytes

Versions: 1

Compression:

Stored size: 821 Bytes

Contents

class SetupDetour < ActiveRecord::Migration
  def change
    create_table :detour_features do |t|
      t.string :name
      t.integer :failure_count, default: 0
      t.timestamps
    end

    add_index :detour_features, :name, unique: true

    create_table :detour_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 :detour_flags, :type
    add_index :detour_flags, :feature_id
    add_index :detour_flags,
      [:type, :feature_id, :flaggable_type, :flaggable_id],
      name: "flag_type_feature_flaggable_type_id"
    add_index :detour_flags,
      [:type, :feature_id, :flaggable_type],
    name: "flag_type_feature_flaggable_type"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
detour-0.0.1 lib/generators/templates/migration.rb