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