Commit 970b5be1 authored by Andreas Brandl's avatar Andreas Brandl

Merge branch 'default_lock_version_to_zero' into 'master'

Set all LockVersion columns to default to 0

See merge request gitlab-org/gitlab!24237
parents bb43a021 3dc91d60
# 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
# 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
# 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
# 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
# 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
# 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
......@@ -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"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment