summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 15:08:40 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 15:08:40 +0000
commit6b833f1e0340e00fdee074da9c42c0d4e07a46d2 (patch)
tree6fc3a7a2f8a02fec8d1e7561b453d33eb4048dad /db
parent88a0824944720b6edaaef56376713541b9a02118 (diff)
downloadgitlab-ce-6b833f1e0340e00fdee074da9c42c0d4e07a46d2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200203025400_default_lock_version_to_zero_for_merge_requests.rb17
-rw-r--r--db/migrate/20200203025602_default_lock_version_to_zero_for_issues.rb17
-rw-r--r--db/migrate/20200203025619_default_lock_version_to_zero_for_epics.rb17
-rw-r--r--db/migrate/20200203025744_default_lock_version_to_zero_for_ci_builds.rb17
-rw-r--r--db/migrate/20200203025801_default_lock_version_to_zero_for_ci_stages.rb17
-rw-r--r--db/migrate/20200203025821_default_lock_version_to_zero_for_ci_pipelines.rb17
-rw-r--r--db/schema.rb14
7 files changed, 109 insertions, 7 deletions
diff --git a/db/migrate/20200203025400_default_lock_version_to_zero_for_merge_requests.rb b/db/migrate/20200203025400_default_lock_version_to_zero_for_merge_requests.rb
new file mode 100644
index 00000000000..c0c58cfa3a7
--- /dev/null
+++ b/db/migrate/20200203025400_default_lock_version_to_zero_for_merge_requests.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class DefaultLockVersionToZeroForMergeRequests < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ with_lock_retries do
+ change_column_default :merge_requests, :lock_version, from: nil, to: 0
+ end
+ end
+end
diff --git a/db/migrate/20200203025602_default_lock_version_to_zero_for_issues.rb b/db/migrate/20200203025602_default_lock_version_to_zero_for_issues.rb
new file mode 100644
index 00000000000..72c265fdf38
--- /dev/null
+++ b/db/migrate/20200203025602_default_lock_version_to_zero_for_issues.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class DefaultLockVersionToZeroForIssues < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ with_lock_retries do
+ change_column_default :issues, :lock_version, from: nil, to: 0
+ end
+ end
+end
diff --git a/db/migrate/20200203025619_default_lock_version_to_zero_for_epics.rb b/db/migrate/20200203025619_default_lock_version_to_zero_for_epics.rb
new file mode 100644
index 00000000000..f44cfd07ee2
--- /dev/null
+++ b/db/migrate/20200203025619_default_lock_version_to_zero_for_epics.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class DefaultLockVersionToZeroForEpics < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ with_lock_retries do
+ change_column_default :epics, :lock_version, from: nil, to: 0
+ end
+ end
+end
diff --git a/db/migrate/20200203025744_default_lock_version_to_zero_for_ci_builds.rb b/db/migrate/20200203025744_default_lock_version_to_zero_for_ci_builds.rb
new file mode 100644
index 00000000000..feda8c36947
--- /dev/null
+++ b/db/migrate/20200203025744_default_lock_version_to_zero_for_ci_builds.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class DefaultLockVersionToZeroForCiBuilds < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ with_lock_retries do
+ change_column_default :ci_builds, :lock_version, from: nil, to: 0
+ end
+ end
+end
diff --git a/db/migrate/20200203025801_default_lock_version_to_zero_for_ci_stages.rb b/db/migrate/20200203025801_default_lock_version_to_zero_for_ci_stages.rb
new file mode 100644
index 00000000000..b825c4ff1c4
--- /dev/null
+++ b/db/migrate/20200203025801_default_lock_version_to_zero_for_ci_stages.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class DefaultLockVersionToZeroForCiStages < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ with_lock_retries do
+ change_column_default :ci_stages, :lock_version, from: nil, to: 0
+ end
+ end
+end
diff --git a/db/migrate/20200203025821_default_lock_version_to_zero_for_ci_pipelines.rb b/db/migrate/20200203025821_default_lock_version_to_zero_for_ci_pipelines.rb
new file mode 100644
index 00000000000..6c4c84cb7e7
--- /dev/null
+++ b/db/migrate/20200203025821_default_lock_version_to_zero_for_ci_pipelines.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class DefaultLockVersionToZeroForCiPipelines < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ with_lock_retries do
+ change_column_default :ci_pipelines, :lock_version, from: nil, to: 0
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e7a1ace68f4..f8be58fe30c 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2020_01_30_161817) do
+ActiveRecord::Schema.define(version: 2020_02_03_025821) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
@@ -659,7 +659,7 @@ ActiveRecord::Schema.define(version: 2020_01_30_161817) do
t.text "yaml_variables"
t.datetime "queued_at"
t.string "token"
- t.integer "lock_version"
+ t.integer "lock_version", default: 0
t.string "coverage_regex"
t.integer "auto_canceled_by_id"
t.boolean "retried"
@@ -835,7 +835,7 @@ ActiveRecord::Schema.define(version: 2020_01_30_161817) do
t.datetime "finished_at"
t.integer "duration"
t.integer "user_id"
- t.integer "lock_version"
+ t.integer "lock_version", default: 0
t.integer "auto_canceled_by_id"
t.integer "pipeline_schedule_id"
t.integer "source"
@@ -949,7 +949,7 @@ ActiveRecord::Schema.define(version: 2020_01_30_161817) do
t.datetime "updated_at"
t.string "name"
t.integer "status"
- t.integer "lock_version"
+ t.integer "lock_version", default: 0
t.integer "position"
t.index ["pipeline_id", "name"], name: "index_ci_stages_on_pipeline_id_and_name", unique: true
t.index ["pipeline_id", "position"], name: "index_ci_stages_on_pipeline_id_and_position"
@@ -1523,7 +1523,7 @@ ActiveRecord::Schema.define(version: 2020_01_30_161817) do
t.integer "cached_markdown_version"
t.integer "updated_by_id"
t.integer "last_edited_by_id"
- t.integer "lock_version"
+ t.integer "lock_version", default: 0
t.date "start_date"
t.date "end_date"
t.datetime "last_edited_at"
@@ -2140,7 +2140,7 @@ ActiveRecord::Schema.define(version: 2020_01_30_161817) do
t.boolean "confidential", default: false, null: false
t.date "due_date"
t.integer "moved_to_id"
- t.integer "lock_version"
+ t.integer "lock_version", default: 0
t.text "title_html"
t.text "description_html"
t.integer "time_estimate"
@@ -2562,7 +2562,7 @@ ActiveRecord::Schema.define(version: 2020_01_30_161817) do
t.integer "approvals_before_merge"
t.string "rebase_commit_sha"
t.string "in_progress_merge_commit_sha"
- t.integer "lock_version"
+ t.integer "lock_version", default: 0
t.text "title_html"
t.text "description_html"
t.integer "time_estimate"