diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-28 12:09:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-28 12:09:01 +0300 |
commit | 67cdfd2683b89bce260600fa8925eefdcdf9e3e5 (patch) | |
tree | 5d01075e0ef7bc62bb27459f75d79ef138aec660 /lib/gitlab/background_migration | |
parent | ca2a7ed5bd43483f10fd74f46f31e32614889738 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/background_migration')
3 files changed, 74 insertions, 0 deletions
diff --git a/lib/gitlab/background_migration/migrate_security_scans.rb b/lib/gitlab/background_migration/migrate_security_scans.rb new file mode 100644 index 00000000000..189a150cb87 --- /dev/null +++ b/lib/gitlab/background_migration/migrate_security_scans.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Gitlab + module BackgroundMigration + # rubocop: disable Style/Documentation + class MigrateSecurityScans + def perform(start_id, stop_id) + end + end + end +end + +Gitlab::BackgroundMigration::MigrateSecurityScans.prepend_if_ee('EE::Gitlab::BackgroundMigration::MigrateSecurityScans') diff --git a/lib/gitlab/background_migration/user_mentions/models/snippet.rb b/lib/gitlab/background_migration/user_mentions/models/snippet.rb new file mode 100644 index 00000000000..1481cfcc562 --- /dev/null +++ b/lib/gitlab/background_migration/user_mentions/models/snippet.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true +# rubocop:disable Style/Documentation + +module Gitlab + module BackgroundMigration + module UserMentions + module Models + class Snippet < ActiveRecord::Base + include IsolatedMentionable + include CacheMarkdownField + include MentionableMigrationMethods + + attr_mentionable :title, pipeline: :single_line + attr_mentionable :description + cache_markdown_field :title, pipeline: :single_line + cache_markdown_field :description + + self.table_name = 'snippets' + self.inheritance_column = :_type_disabled + + belongs_to :author, class_name: "User" + belongs_to :project + + def self.user_mention_model + Gitlab::BackgroundMigration::UserMentions::Models::SnippetUserMention + end + + def user_mention_model + self.class.user_mention_model + end + + def user_mention_resource_id + id + end + + def user_mention_note_id + 'NULL' + end + end + end + end + end +end diff --git a/lib/gitlab/background_migration/user_mentions/models/snippet_user_mention.rb b/lib/gitlab/background_migration/user_mentions/models/snippet_user_mention.rb new file mode 100644 index 00000000000..a856a53626e --- /dev/null +++ b/lib/gitlab/background_migration/user_mentions/models/snippet_user_mention.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true +# rubocop:disable Style/Documentation + +module Gitlab + module BackgroundMigration + module UserMentions + module Models + class SnippetUserMention < ActiveRecord::Base + self.table_name = 'snippet_user_mentions' + + def self.resource_foreign_key + :snippet_id + end + end + end + end + end +end |