docbrown/db/migrate/20200221184007_create_field_test_memberships.rb
Ben Halpern 1dc1723709
Add field test gem to establish a/b testing (#6283) [deploy]
* Initial field test spec work

* Clean up specs

* Fix codeclimage

* Cleanups

* Update names

* Rename and remove need to pass logged in status

* Leadup to prod: two experiments

* Move test logic to controller and add tests

Co-authored-by: Josh Puetz <josh@grorichpuetz.com>
2020-03-03 10:21:29 -05:00

16 lines
560 B
Ruby

class CreateFieldTestMemberships < ActiveRecord::Migration[5.2]
def change
create_table :field_test_memberships do |t|
t.string :participant_type
t.string :participant_id
t.string :experiment
t.string :variant
t.timestamp :created_at
t.boolean :converted, default: false
end
add_index :field_test_memberships, [:participant_type, :participant_id, :experiment],
unique: true, name: "index_field_test_memberships_on_participant"
add_index :field_test_memberships, [:experiment, :created_at]
end
end