diff options
author | Sean McGivern <sean@gitlab.com> | 2017-04-05 15:49:22 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-04-14 16:20:55 +0300 |
commit | c53afeda0c2ee0cda89c235c9e8799baa1cfdc1a (patch) | |
tree | 7efaef06c5ec20fc87fe6dadf1a794c8ef00f187 /db | |
parent | f5b42881c88678cd85ea7743fdffa400105b4b8d (diff) |
Port 'Add uuid to usage ping' to CE
CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1521
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170328010804_add_uuid_to_application_settings.rb | 16 | ||||
-rw-r--r-- | db/schema.rb | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20170328010804_add_uuid_to_application_settings.rb b/db/migrate/20170328010804_add_uuid_to_application_settings.rb new file mode 100644 index 00000000000..5dfcc751c7b --- /dev/null +++ b/db/migrate/20170328010804_add_uuid_to_application_settings.rb @@ -0,0 +1,16 @@ +class AddUuidToApplicationSettings < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_column :application_settings, :uuid, :string + execute("UPDATE application_settings SET uuid = #{quote(SecureRandom.uuid)}") + end + + def down + remove_column :application_settings, :uuid + end +end diff --git a/db/schema.rb b/db/schema.rb index 7c5bb94dfb0..1c592dd5d6d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -117,6 +117,7 @@ ActiveRecord::Schema.define(version: 20170408033905) do t.boolean "unique_ips_limit_enabled", default: false, null: false t.decimal "polling_interval_multiplier", default: 1.0, null: false t.boolean "usage_ping_enabled", default: true, null: false + t.string "uuid" end create_table "audit_events", force: :cascade do |t| |