Commit 66793be6 authored by Andreas Brandl's avatar Andreas Brandl

Merge branch '226989-remove-users-bio-column' into 'master'

Remove users.bio column

Closes #226989

See merge request gitlab-org/gitlab!40269
parents 5339dcec e8cd2f6e
---
title: Remove unused users.bio database column
merge_request: 40269
author:
type: other
# frozen_string_literal: true
class RemoveIndexOnUsersBio < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
BACKGROUND_MIGRATION_CLASS = 'MigrateUsersBioToUserDetails'
INDEX_NAME = 'tmp_idx_on_user_id_where_bio_is_filled'
disable_ddl_transaction!
def up
Gitlab::BackgroundMigration.steal(BACKGROUND_MIGRATION_CLASS)
remove_concurrent_index_by_name(:users, INDEX_NAME)
end
def down
add_concurrent_index :users, :id, where: "(COALESCE(bio, '') IS DISTINCT FROM '')", name: INDEX_NAME
end
end
# frozen_string_literal: true
class RemoveUsersBioColumn < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
with_lock_retries do
remove_column :users, :bio
end
end
def down
with_lock_retries do
add_column :users, :bio, :string # rubocop: disable Migration/AddColumnsToWideTables
end
end
end
891f1660592c4443aeced7594cea391066cc79b54b40c67a8c973eb6959bf6f1
\ No newline at end of file
e6dcd20fe77c443999aa2373e0acdd77eb68c3a6f0d6d65e86b7f85ac97ddb9a
\ No newline at end of file
...@@ -16129,7 +16129,6 @@ CREATE TABLE public.users ( ...@@ -16129,7 +16129,6 @@ CREATE TABLE public.users (
skype character varying DEFAULT ''::character varying NOT NULL, skype character varying DEFAULT ''::character varying NOT NULL,
linkedin character varying DEFAULT ''::character varying NOT NULL, linkedin character varying DEFAULT ''::character varying NOT NULL,
twitter character varying DEFAULT ''::character varying NOT NULL, twitter character varying DEFAULT ''::character varying NOT NULL,
bio character varying,
failed_attempts integer DEFAULT 0, failed_attempts integer DEFAULT 0,
locked_at timestamp without time zone, locked_at timestamp without time zone,
username character varying, username character varying,
...@@ -21137,8 +21136,6 @@ CREATE INDEX terraform_states_verification_failure_partial ON public.terraform_s ...@@ -21137,8 +21136,6 @@ CREATE INDEX terraform_states_verification_failure_partial ON public.terraform_s
CREATE INDEX tmp_build_stage_position_index ON public.ci_builds USING btree (stage_id, stage_idx) WHERE (stage_idx IS NOT NULL); CREATE INDEX tmp_build_stage_position_index ON public.ci_builds USING btree (stage_id, stage_idx) WHERE (stage_idx IS NOT NULL);
CREATE INDEX tmp_idx_on_user_id_where_bio_is_filled ON public.users USING btree (id) WHERE ((COALESCE(bio, ''::character varying))::text IS DISTINCT FROM ''::text);
CREATE INDEX tmp_index_for_email_unconfirmation_migration ON public.emails USING btree (id) WHERE (confirmed_at IS NOT NULL); CREATE INDEX tmp_index_for_email_unconfirmation_migration ON public.emails USING btree (id) WHERE (confirmed_at IS NOT NULL);
CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON public.merge_request_metrics USING btree (merge_request_id); CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON public.merge_request_metrics USING btree (merge_request_id);
......
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