Class: CreateFlipperTables
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateFlipperTables
- Defined in:
- lib/generators/flipper/templates/migration.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
18 19 20 21 |
# File 'lib/generators/flipper/templates/migration.rb', line 18 def self.down drop_table :flipper_gates drop_table :flipper_features end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/generators/flipper/templates/migration.rb', line 2 def self.up create_table :flipper_features do |t| t.string :key, null: false t. null: false end add_index :flipper_features, :key, unique: true create_table :flipper_gates do |t| t.string :feature_key, null: false t.string :key, null: false t.string :value t. null: false end add_index :flipper_gates, [:feature_key, :key, :value], unique: true end |