diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 12:09:23 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 12:09:23 +0300 |
commit | 4cb5e5011abfe8d50ac3a7ebd0018c563c6d7af4 (patch) | |
tree | 82591df15758864325897043f855b4e4dfcb6a56 /db | |
parent | 0301a0cad0063d76b1607358dc6c711ea043fdda (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
4 files changed, 46 insertions, 0 deletions
diff --git a/db/migrate/20200303055348_add_expires_at_to_keys.rb b/db/migrate/20200303055348_add_expires_at_to_keys.rb new file mode 100644 index 00000000000..ef7b813a2ef --- /dev/null +++ b/db/migrate/20200303055348_add_expires_at_to_keys.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddExpiresAtToKeys < ActiveRecord::Migration[6.0] + DOWNTIME = false + + def change + add_column :keys, :expires_at, :datetime_with_timezone + end +end diff --git a/db/migrate/20200311084025_add_index_on_user_id_status_created_at_to_deployments.rb b/db/migrate/20200311084025_add_index_on_user_id_status_created_at_to_deployments.rb new file mode 100644 index 00000000000..1744b701f0a --- /dev/null +++ b/db/migrate/20200311084025_add_index_on_user_id_status_created_at_to_deployments.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexOnUserIdStatusCreatedAtToDeployments < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :deployments, [:user_id, :status, :created_at] + end + + def down + remove_concurrent_index :deployments, [:user_id, :status, :created_at] + end +end diff --git a/db/migrate/20200311094020_add_index_on_id_and_status_to_deployments.rb b/db/migrate/20200311094020_add_index_on_id_and_status_to_deployments.rb new file mode 100644 index 00000000000..77c746ed88b --- /dev/null +++ b/db/migrate/20200311094020_add_index_on_id_and_status_to_deployments.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexOnIdAndStatusToDeployments < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :deployments, [:id, :status] + end + + def down + remove_concurrent_index :deployments, [:id, :status] + end +end diff --git a/db/schema.rb b/db/schema.rb index 06f2011c568..ca12b77bd2e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1409,6 +1409,7 @@ ActiveRecord::Schema.define(version: 2020_03_11_165635) do t.index ["environment_id", "id"], name: "index_deployments_on_environment_id_and_id" t.index ["environment_id", "iid", "project_id"], name: "index_deployments_on_environment_id_and_iid_and_project_id" t.index ["environment_id", "status"], name: "index_deployments_on_environment_id_and_status" + t.index ["id", "status"], name: "index_deployments_on_id_and_status" t.index ["id"], name: "partial_index_deployments_for_legacy_successful_deployments", where: "((finished_at IS NULL) AND (status = 2))" t.index ["project_id", "id"], name: "index_deployments_on_project_id_and_id", order: { id: :desc } t.index ["project_id", "iid"], name: "index_deployments_on_project_id_and_iid", unique: true @@ -1417,6 +1418,7 @@ ActiveRecord::Schema.define(version: 2020_03_11_165635) do t.index ["project_id", "status"], name: "index_deployments_on_project_id_and_status" t.index ["project_id", "updated_at", "id"], name: "index_deployments_on_project_id_and_updated_at_and_id", order: { updated_at: :desc, id: :desc } t.index ["project_id"], name: "partial_index_deployments_for_project_id_and_tag", where: "(tag IS TRUE)" + t.index ["user_id", "status", "created_at"], name: "index_deployments_on_user_id_and_status_and_created_at" end create_table "description_versions", force: :cascade do |t| @@ -2291,6 +2293,7 @@ ActiveRecord::Schema.define(version: 2020_03_11_165635) do t.boolean "public", default: false, null: false t.datetime "last_used_at" t.binary "fingerprint_sha256" + t.datetime_with_timezone "expires_at" t.index ["fingerprint"], name: "index_keys_on_fingerprint", unique: true t.index ["fingerprint_sha256"], name: "index_keys_on_fingerprint_sha256" t.index ["id", "type"], name: "index_on_deploy_keys_id_and_type_and_public", unique: true, where: "(public = true)" |