Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-20 09:09:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-20 09:09:10 +0300
commit13cacc20b0bd96abfdf92bbabf0fb23ab46522d5 (patch)
tree84bab7af22dec8d8e494a9b8c0a51473521d1f89 /db
parentb0348fa2727fed578fc53d8d0c6d5f0177c799d5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20201119213406_change_terraform_versioning_enabled_default.rb9
-rw-r--r--db/post_migrate/20201112145311_add_index_on_sha_for_initial_deployments.rb21
-rw-r--r--db/schema_migrations/202011121453111
-rw-r--r--db/schema_migrations/202011192134061
-rw-r--r--db/structure.sql4
5 files changed, 34 insertions, 2 deletions
diff --git a/db/migrate/20201119213406_change_terraform_versioning_enabled_default.rb b/db/migrate/20201119213406_change_terraform_versioning_enabled_default.rb
new file mode 100644
index 00000000000..490fe481589
--- /dev/null
+++ b/db/migrate/20201119213406_change_terraform_versioning_enabled_default.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class ChangeTerraformVersioningEnabledDefault < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def change
+ change_column_default :terraform_states, :versioning_enabled, from: false, to: true
+ end
+end
diff --git a/db/post_migrate/20201112145311_add_index_on_sha_for_initial_deployments.rb b/db/post_migrate/20201112145311_add_index_on_sha_for_initial_deployments.rb
new file mode 100644
index 00000000000..15debddb9cc
--- /dev/null
+++ b/db/post_migrate/20201112145311_add_index_on_sha_for_initial_deployments.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class AddIndexOnShaForInitialDeployments < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ NEW_INDEX_NAME = 'index_deployments_on_environment_status_sha'
+ OLD_INDEX_NAME = 'index_deployments_on_environment_id_and_status'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :deployments, %i[environment_id status sha], name: NEW_INDEX_NAME
+ remove_concurrent_index_by_name :deployments, OLD_INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :deployments, %i[environment_id status], name: OLD_INDEX_NAME
+ remove_concurrent_index_by_name :services, NEW_INDEX_NAME
+ end
+end
diff --git a/db/schema_migrations/20201112145311 b/db/schema_migrations/20201112145311
new file mode 100644
index 00000000000..b6b88862a38
--- /dev/null
+++ b/db/schema_migrations/20201112145311
@@ -0,0 +1 @@
+085bb21bdbe3d062b3000d63c111aab5ba75c7e049c32779cccac5c320583759 \ No newline at end of file
diff --git a/db/schema_migrations/20201119213406 b/db/schema_migrations/20201119213406
new file mode 100644
index 00000000000..0bd2418a6ee
--- /dev/null
+++ b/db/schema_migrations/20201119213406
@@ -0,0 +1 @@
+33970a1295b84040c82034041c99f13578352844c9c6cb092b5cc35913576a7e \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index d65c1a3dd35..3887be372d5 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -16644,7 +16644,7 @@ CREATE TABLE terraform_states (
locked_by_user_id bigint,
uuid character varying(32) NOT NULL,
name character varying(255),
- versioning_enabled boolean DEFAULT false NOT NULL
+ versioning_enabled boolean DEFAULT true NOT NULL
);
CREATE SEQUENCE terraform_states_id_seq
@@ -20721,7 +20721,7 @@ CREATE INDEX index_deployments_on_environment_id_and_id ON deployments USING btr
CREATE INDEX index_deployments_on_environment_id_and_iid_and_project_id ON deployments USING btree (environment_id, iid, project_id);
-CREATE INDEX index_deployments_on_environment_id_and_status ON deployments USING btree (environment_id, status);
+CREATE INDEX index_deployments_on_environment_status_sha ON deployments USING btree (environment_id, status, sha);
CREATE INDEX index_deployments_on_id_and_status_and_created_at ON deployments USING btree (id, status, created_at);