Class: CreateFlipperTablesSequel

Inherits:
Sequel::Migration
  • Object
show all
Defined in:
lib/generators/flipper/templates/sequel_migration.rb

Instance Method Summary collapse

Instance Method Details

#downObject



19
20
21
22
# File 'lib/generators/flipper/templates/sequel_migration.rb', line 19

def down
  drop_table :flipper_gates
  drop_table :flipper_features
end

#upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/flipper/templates/sequel_migration.rb', line 2

def up
  create_table :flipper_features do |_t|
    String :key, primary_key: true, null: false
    DateTime :created_at, null: false
    DateTime :updated_at, null: false
  end

  create_table :flipper_gates do |_t|
    String :feature_key, null: false
    String :key, null: false
    String :value, text: true
    DateTime :created_at, null: false
    DateTime :updated_at, null: false
    primary_key [:feature_key, :key, :value]
  end
end