2018-01-26 11:06:52 -05:00
|
|
|
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
|
|
|
|
# for more information on how to write migrations for GitLab.
|
|
|
|
|
|
|
|
class CreateCallouts < ActiveRecord::Migration
|
|
|
|
# Set this constant to true if this migration requires downtime.
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def change
|
|
|
|
create_table :callouts do |t|
|
|
|
|
t.string :feature_name, null: false
|
|
|
|
t.references :user, index: true, foreign_key: { on_delete: :cascade }, null: false
|
|
|
|
end
|
|
|
|
|
2018-02-01 21:07:33 -05:00
|
|
|
add_index :callouts, [:user_id, :feature_name], unique: true
|
2018-01-26 11:06:52 -05:00
|
|
|
end
|
|
|
|
end
|