diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20180906101639_add_user_ping_consent_to_application_settings.rb | 19 | ||||
-rw-r--r-- | db/schema.rb | 4 |
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 |