Class: CreateAbTests

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

Class Method Summary collapse

Class Method Details

.downObject



14
15
16
# File 'lib/generators/guinea_pig/templates/create_ab_tests.rb', line 14

def self.down
  drop_table :ab_tests
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/generators/guinea_pig/templates/create_ab_tests.rb', line 2

def self.up
  create_table :ab_tests do |t|
    t.string      :experiment, :null => false
    t.string      :alternative, :null => false
    t.integer     :guinea_pig_id, :null => false
    t.string      :guinea_pig_type, :null => false
    t.integer     :seen_count, :default => 0
    t.integer     :conversion_count, :default => 0
    t.timestamps
  end
end