diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-06 15:10:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-06 15:10:29 +0300 |
commit | 5564275a0b378298dc6281599cbfe71a937109ff (patch) | |
tree | a468e1e60046356410219c35c23a8a428c5e2c5e /db | |
parent | d87918510a866a5fcbbc2f899ad65c6938ebf5f5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
5 files changed, 80 insertions, 1 deletions
diff --git a/db/migrate/20191217165641_add_saml_provider_prohibited_outer_forks.rb b/db/migrate/20191217165641_add_saml_provider_prohibited_outer_forks.rb new file mode 100644 index 00000000000..6cd32cdcfe9 --- /dev/null +++ b/db/migrate/20191217165641_add_saml_provider_prohibited_outer_forks.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddSamlProviderProhibitedOuterForks < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_column_with_default :saml_providers, :prohibited_outer_forks, :boolean, default: false, allow_null: true + end + + def down + remove_column :saml_providers, :prohibited_outer_forks + end +end diff --git a/db/migrate/20191218190253_add_tab_width_to_user_preferences.rb b/db/migrate/20191218190253_add_tab_width_to_user_preferences.rb new file mode 100644 index 00000000000..b03dd8f76b9 --- /dev/null +++ b/db/migrate/20191218190253_add_tab_width_to_user_preferences.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddTabWidthToUserPreferences < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + add_column(:user_preferences, :tab_width, :integer, limit: 2) + end +end diff --git a/db/migrate/20200121200203_create_group_deploy_tokens.rb b/db/migrate/20200121200203_create_group_deploy_tokens.rb new file mode 100644 index 00000000000..55b30745fcf --- /dev/null +++ b/db/migrate/20200121200203_create_group_deploy_tokens.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateGroupDeployTokens < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + create_table :group_deploy_tokens do |t| + t.timestamps_with_timezone null: false + + t.references :group, index: false, null: false, foreign_key: { to_table: :namespaces, on_delete: :cascade } + t.references :deploy_token, null: false, foreign_key: { on_delete: :cascade } + + t.index [:group_id, :deploy_token_id], unique: true, name: 'index_group_deploy_tokens_on_group_and_deploy_token_ids' + end + end +end diff --git a/db/migrate/20200129172428_add_index_on_audit_events_id_desc.rb b/db/migrate/20200129172428_add_index_on_audit_events_id_desc.rb new file mode 100644 index 00000000000..b9182c99ebf --- /dev/null +++ b/db/migrate/20200129172428_add_index_on_audit_events_id_desc.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class AddIndexOnAuditEventsIdDesc < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + OLD_INDEX_NAME = 'index_audit_events_on_entity_id_and_entity_type' + NEW_INDEX_NAME = 'index_audit_events_on_entity_id_and_entity_type_and_id_desc' + + disable_ddl_transaction! + + def up + add_concurrent_index :audit_events, [:entity_id, :entity_type, :id], name: NEW_INDEX_NAME, + order: { entity_id: :asc, entity_type: :asc, id: :desc } + + remove_concurrent_index_by_name :audit_events, OLD_INDEX_NAME + end + + def down + add_concurrent_index :audit_events, [:entity_id, :entity_type], name: OLD_INDEX_NAME + + remove_concurrent_index_by_name :audit_events, NEW_INDEX_NAME + end +end diff --git a/db/schema.rb b/db/schema.rb index 1c96e4eefcf..1050b265acb 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -465,7 +465,7 @@ ActiveRecord::Schema.define(version: 2020_02_04_131054) do t.datetime "created_at" t.datetime "updated_at" t.index ["created_at", "author_id"], name: "analytics_index_audit_events_on_created_at_and_author_id" - t.index ["entity_id", "entity_type"], name: "index_audit_events_on_entity_id_and_entity_type" + t.index ["entity_id", "entity_type", "id"], name: "index_audit_events_on_entity_id_and_entity_type_and_id_desc", order: { id: :desc } end create_table "award_emoji", id: :serial, force: :cascade do |t| @@ -1979,6 +1979,15 @@ ActiveRecord::Schema.define(version: 2020_02_04_131054) do t.index ["user_id"], name: "index_group_deletion_schedules_on_user_id" end + create_table "group_deploy_tokens", force: :cascade do |t| + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.bigint "group_id", null: false + t.bigint "deploy_token_id", null: false + t.index ["deploy_token_id"], name: "index_group_deploy_tokens_on_deploy_token_id" + t.index ["group_id", "deploy_token_id"], name: "index_group_deploy_tokens_on_group_and_deploy_token_ids", unique: true + end + create_table "group_group_links", force: :cascade do |t| t.datetime_with_timezone "created_at", null: false t.datetime_with_timezone "updated_at", null: false @@ -3735,6 +3744,7 @@ ActiveRecord::Schema.define(version: 2020_02_04_131054) do t.string "sso_url", null: false t.boolean "enforced_sso", default: false, null: false t.boolean "enforced_group_managed_accounts", default: false, null: false + t.boolean "prohibited_outer_forks", default: false, null: false t.index ["group_id"], name: "index_saml_providers_on_group_id" end @@ -4133,6 +4143,7 @@ ActiveRecord::Schema.define(version: 2020_02_04_131054) do t.boolean "sourcegraph_enabled" t.boolean "setup_for_company" t.boolean "render_whitespace_in_code" + t.integer "tab_width", limit: 2 t.index ["user_id"], name: "index_user_preferences_on_user_id", unique: true end @@ -4691,6 +4702,8 @@ ActiveRecord::Schema.define(version: 2020_02_04_131054) do add_foreign_key "group_custom_attributes", "namespaces", column: "group_id", on_delete: :cascade add_foreign_key "group_deletion_schedules", "namespaces", column: "group_id", on_delete: :cascade add_foreign_key "group_deletion_schedules", "users", name: "fk_11e3ebfcdd", on_delete: :cascade + add_foreign_key "group_deploy_tokens", "deploy_tokens", on_delete: :cascade + add_foreign_key "group_deploy_tokens", "namespaces", column: "group_id", on_delete: :cascade add_foreign_key "group_group_links", "namespaces", column: "shared_group_id", on_delete: :cascade add_foreign_key "group_group_links", "namespaces", column: "shared_with_group_id", on_delete: :cascade add_foreign_key "identities", "saml_providers", name: "fk_aade90f0fc", on_delete: :cascade |