Commit 89ea6a99 authored by Matija Čupić's avatar Matija Čupić

Add Callout model

parent 4376be84
class Callout < ActiveRecord::Base
belongs_to :user
end
......@@ -137,6 +137,7 @@ class User < ActiveRecord::Base
has_many :assigned_merge_requests, dependent: :nullify, foreign_key: :assignee_id, class_name: "MergeRequest" # rubocop:disable Cop/ActiveRecordDependent
has_many :custom_attributes, class_name: 'UserCustomAttribute'
has_many :callouts
#
# Validations
......
# 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.boolean :dismissed_state, null: false
t.references :user, index: true, foreign_key: { on_delete: :cascade }, null: false
t.timestamps_with_timezone null: false
end
add_index :callouts, :feature_name, unique: true
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment