summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-09-07 14:32:28 +0000
committerDouwe Maan <douwe@gitlab.com>2018-09-07 14:32:28 +0000
commita415a904b8b03543dfdfab4667336b603b45eb28 (patch)
tree7cca179d7f884fc54afeccb2285469dbbcef3a53 /db
parent1f765ce9ea25b45cd702c25ccb762eacceb9a4ae (diff)
downloadgitlab-ce-a415a904b8b03543dfdfab4667336b603b45eb28.tar.gz
Ask user explicitly about usage stats agreement
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180906101639_add_user_ping_consent_to_application_settings.rb19
-rw-r--r--db/schema.rb4
2 files changed, 22 insertions, 1 deletions
diff --git a/db/migrate/20180906101639_add_user_ping_consent_to_application_settings.rb b/db/migrate/20180906101639_add_user_ping_consent_to_application_settings.rb
new file mode 100644
index 00000000000..5d0e67d2648
--- /dev/null
+++ b/db/migrate/20180906101639_add_user_ping_consent_to_application_settings.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddUserPingConsentToApplicationSettings < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_column :application_settings, :usage_stats_set_by_user_id, :integer
+ add_concurrent_foreign_key :application_settings, :users, column: :usage_stats_set_by_user_id, on_delete: :nullify
+ end
+
+ def down
+ remove_foreign_key :application_settings, column: :usage_stats_set_by_user_id
+ remove_column :application_settings, :usage_stats_set_by_user_id
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e0b704f82d4..a417d0bc70a 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20180901200537) do
+ActiveRecord::Schema.define(version: 20180906101639) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -172,6 +172,7 @@ ActiveRecord::Schema.define(version: 20180901200537) do
t.boolean "instance_statistics_visibility_private", default: false, null: false
t.boolean "web_ide_clientside_preview_enabled", default: false, null: false
t.boolean "user_show_add_ssh_key_message", default: true, null: false
+ t.integer "usage_stats_set_by_user_id"
end
create_table "audit_events", force: :cascade do |t|
@@ -2275,6 +2276,7 @@ ActiveRecord::Schema.define(version: 20180901200537) do
add_index "web_hooks", ["project_id"], name: "index_web_hooks_on_project_id", using: :btree
add_index "web_hooks", ["type"], name: "index_web_hooks_on_type", using: :btree
+ add_foreign_key "application_settings", "users", column: "usage_stats_set_by_user_id", name: "fk_964370041d", on_delete: :nullify
add_foreign_key "badges", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "badges", "projects", on_delete: :cascade
add_foreign_key "boards", "namespaces", column: "group_id", on_delete: :cascade