summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-02-05 14:24:43 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-02-05 14:24:43 +0000
commit9edd95658308f3e0e8e6df6eb829555a3cb418d1 (patch)
tree9b5d96752c3eb767c603bdf12f381abc9604d0dd /db
parentbedfc7b103c25cd6b9aada350142549160e41a5e (diff)
parentf24705212791072a93edd4f7b1c530507b6a2c49 (diff)
downloadgitlab-ce-9edd95658308f3e0e8e6df6eb829555a3cb418d1.tar.gz
Merge branch 'persistent-callouts' into 'master'
Add backend for persistently dismissible callouts See merge request gitlab-org/gitlab-ce!16735
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180125214301_create_user_callouts.rb16
-rw-r--r--db/schema.rb9
2 files changed, 25 insertions, 0 deletions
diff --git a/db/migrate/20180125214301_create_user_callouts.rb b/db/migrate/20180125214301_create_user_callouts.rb
new file mode 100644
index 00000000000..856eff36ae0
--- /dev/null
+++ b/db/migrate/20180125214301_create_user_callouts.rb
@@ -0,0 +1,16 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class CreateUserCallouts < ActiveRecord::Migration
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ create_table :user_callouts do |t|
+ t.integer :feature_name, null: false
+ t.references :user, index: true, foreign_key: { on_delete: :cascade }, null: false
+ end
+
+ add_index :user_callouts, [:user_id, :feature_name], unique: true
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index c701a5f1e17..14024164359 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1769,6 +1769,14 @@ ActiveRecord::Schema.define(version: 20180202111106) do
add_index "user_agent_details", ["subject_id", "subject_type"], name: "index_user_agent_details_on_subject_id_and_subject_type", using: :btree
+ create_table "user_callouts", force: :cascade do |t|
+ t.integer "feature_name", null: false
+ t.integer "user_id", null: false
+ end
+
+ add_index "user_callouts", ["user_id", "feature_name"], name: "index_user_callouts_on_user_id_and_feature_name", unique: true, using: :btree
+ add_index "user_callouts", ["user_id"], name: "index_user_callouts_on_user_id", using: :btree
+
create_table "user_custom_attributes", force: :cascade do |t|
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
@@ -2040,6 +2048,7 @@ ActiveRecord::Schema.define(version: 20180202111106) do
add_foreign_key "todos", "projects", name: "fk_45054f9c45", on_delete: :cascade
add_foreign_key "trending_projects", "projects", on_delete: :cascade
add_foreign_key "u2f_registrations", "users"
+ add_foreign_key "user_callouts", "users", on_delete: :cascade
add_foreign_key "user_custom_attributes", "users", on_delete: :cascade
add_foreign_key "user_synced_attributes_metadata", "users", on_delete: :cascade
add_foreign_key "users_star_projects", "projects", name: "fk_22cd27ddfc", on_delete: :cascade