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
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/background_migration/migrate_users_bio_to_user_details.rb')
-rw-r--r--lib/gitlab/background_migration/migrate_users_bio_to_user_details.rb32
1 files changed, 0 insertions, 32 deletions
diff --git a/lib/gitlab/background_migration/migrate_users_bio_to_user_details.rb b/lib/gitlab/background_migration/migrate_users_bio_to_user_details.rb
deleted file mode 100644
index bbe2164ae4e..00000000000
--- a/lib/gitlab/background_migration/migrate_users_bio_to_user_details.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-# rubocop:disable Style/Documentation
-
-module Gitlab
- module BackgroundMigration
- class MigrateUsersBioToUserDetails
- class User < ActiveRecord::Base
- self.table_name = 'users'
- end
-
- class UserDetails < ActiveRecord::Base
- self.table_name = 'user_details'
- end
-
- def perform(start_id, stop_id)
- relation = User
- .select("id AS user_id", "substring(COALESCE(bio, '') from 1 for 255) AS bio")
- .where("(COALESCE(bio, '') IS DISTINCT FROM '')")
- .where(id: (start_id..stop_id))
-
- ActiveRecord::Base.connection.execute <<-EOF.strip_heredoc
- INSERT INTO user_details
- (user_id, bio)
- #{relation.to_sql}
- ON CONFLICT (user_id)
- DO UPDATE SET
- "bio" = EXCLUDED."bio";
- EOF
- end
- end
- end
-end