Remove Users.support_bot column

This column is not present in `db/schema.rb` and hence needs to be
removed conditionally.

See https://gitlab.com/gitlab-org/gitlab-ce/issues/66901 for background
This commit is contained in:
Andreas Brandl 2019-09-02 18:26:47 +02:00
parent f4e40c532b
commit 1b81a81b95
No known key found for this signature in database
GPG Key ID: F25982B13FEE55DA
3 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
title: Remove Users.support_bot column
merge_request: 32554
author:
type: other

View File

@ -0,0 +1,19 @@
# frozen_string_literal: true
class RemoveSupportBotColumnFromUsers < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
return unless column_exists?(:users, :support_bot)
remove_column :users, :support_bot
end
def down
# no-op because the column should not exist in the previous version
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_09_02_131045) do
ActiveRecord::Schema.define(version: 2019_09_02_160015) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"